runthis Posted July 13, 2011 Share Posted July 13, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/241875-ajax-form/ Share on other sites More sharing options...
trq Posted July 13, 2011 Share Posted July 13, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/241875-ajax-form/#findComment-1242135 Share on other sites More sharing options...
runthis Posted July 13, 2011 Author Share Posted July 13, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/241875-ajax-form/#findComment-1242250 Share on other sites More sharing options...
trq Posted July 14, 2011 Share Posted July 14, 2011 Did you bother to read the rest of the answer? Quote Link to comment https://forums.phpfreaks.com/topic/241875-ajax-form/#findComment-1242535 Share on other sites More sharing options...
AyKay47 Posted July 14, 2011 Share Posted July 14, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/241875-ajax-form/#findComment-1242538 Share on other sites More sharing options...
runthis Posted July 14, 2011 Author Share Posted July 14, 2011 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 }); } Quote Link to comment https://forums.phpfreaks.com/topic/241875-ajax-form/#findComment-1242566 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.