4

I have a jquery mobile form that is wrapped around two pages :

<form ...>
<div data-role="page">
...
</div>
<div data-role="page">
...
</div>
</form>

It works pretty good when this page is loaded via the browser.

However, when the page is called via Ajax, as you would expect, the form tag is not imported in the dom hence the form broken.

Is there any solution besides rewriting the hole flow ?

Thanks !

Edit : I would like to keep the ajax navigation, i'm aware i could fix that by just calling this page w/out ajax.

Intrepidd
  • 19,772
  • 6
  • 55
  • 63
  • I don't think you can keep this behavior with ajax requests. Maybe you can just use a single page with the complete form and turn the first/second part of the form visible/invisble. – micha Dec 16 '12 at 13:16

2 Answers2

0

You could serialize the form data and save it as a local var until the final step/page. This is covered very well on this guys post: http://www.raymondcamden.com/index.cfm/2011/11/22/Demo-of-a-multistep-form-in-jQuery-Mobile-Part-2

Cheers!

shanabus
  • 12,989
  • 6
  • 52
  • 78
-1

I finally managed to do otherwise since there was no easy way to achieve this ...

Intrepidd
  • 19,772
  • 6
  • 55
  • 63
  • Hey @Intrepidd I have a similar issue, how did you solve this? Cheers – Mimo Feb 19 '13 at 07:01
  • Hey @mimo, I had to refactor my flow and stop using ajax navigation for this part of the website. Ping me if you find something better :) – Intrepidd Feb 19 '13 at 09:09