Serializing forms: breaking one form into several pages

Sometimes it is desirable to break a single form into several logical pages, which compose a single form submission. There are two basic approaches to doing this in M-Business Anywhere:

  • Serialize from a single page – Put all of your form fields on a single page, then use DHTML's CSS display attribute to selectively hide and display information for the different logical pages, so that only one "page" appears at a time. All "pages" are processed in a single form submission, preserving the idea of one form/one page.

  • Serialize using Submission Manager – Use DOM operations on the Submission Manager to build multiple pages, and a single form, in which the application operates on a single form submission. As a page is loaded, the value is concatenated to a submission whose name is stored in a persistent datastore to keep track of all the associated form values. The persistent datastore can be the avantgo.preferences object, the Forms Manager, or the on-device M-Business XML datastore. This example uses the avantgo.preferences object.

A pair of code samples, each illustrating one of the above approaches, is available online. See Serializing form submissions with M-Business Client.