Jump to content

Ajax Form


runthis

Recommended Posts

I understand completely how to submit a form with ajax, my question is, how do you get the page its supposed to post to, to appear like an actual form does.

Like im posting to 'boobs.php' in ajax i submit to boobs.php, but how do i get boobs.php to also be the resulting outcome, like an original form does?

The old school way or with prototype.

Link to comment
https://forums.phpfreaks.com/topic/241875-ajax-form/
Share on other sites

You want the page to change appearance after the form has been submitted? Is that your question?

 

The easiest way is to not bother using Ajax, done. If you still want to use Ajax you will need to (once the form has been submitted) remove the form from the DOM and replace it with whatever you want.

Link to comment
https://forums.phpfreaks.com/topic/241875-ajax-form/#findComment-1242135
Share on other sites

Ok that was a bad answer, i am definitely looking for a better one than (dont use ajax) in a fucking ajax forum... anyone?

 

Edit: actually that was an administrators answer..meh nevermind, ill figure it out myself or try another forum.

are you really that hostile to a forum that gives programming advice for free?  :headslap:

Link to comment
https://forums.phpfreaks.com/topic/241875-ajax-form/#findComment-1242538
Share on other sites

No, i solved the answer on my own, and it was involving forms in dynamically created objects.

 

post=function(){ 
var params="username="+document.getElementById('username').value+"&password="+document.getElementById('password').value+"";
new Ajax.Updater('LoadId', 'file.php', {
method:'post', parameters:params,evalScripts: true
});
}

Link to comment
https://forums.phpfreaks.com/topic/241875-ajax-form/#findComment-1242566
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.