AJAX form sections - how to pass url of next stage of form

Posted by dan727 on Stack Overflow See other posts from Stack Overflow or by dan727
Published on 2010-04-28T19:52:59Z Indexed on 2010/04/28 19:57 UTC
Read the original article Hit count: 206

Filed under:
|
|
|

Hi, I've got a multi-part form (in a PHP MVC setup) which I have working correctly without javascript enhancement. I'm starting to add the AJAX form handling code which will handle each stage of a form submission, validating/saving data etc, before using AJAX to load the next stage of the form. I'm wondering how best to pass the URL of the next stage to the current form being processed, so that my jQuery form handling code can process the current form, then load the next part via AJAX. The form "action" is different from what the url of the next stage of the form is - what do you think would be good practice here? I was thinking about either appending the url of the next stage to the form action url, via a query string - then just use javascript to extract this url when the form is successfully processed. The other option is via a hidden form element. Not sure what other client side options I have here

Any thoughts?

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about web-development