Expand my Community achievements bar.

Field validation on multiple pages

Avatar

Former Community Member
I have created an xdp where users will only see one page at a time (to simulate a wizard driven application). This is done using addInstance() and removeInstance(). The rendering works fine. The user will see only 1 page at a time. The user can navigate to other pages by clicking on a page number at top of every page (master page). I have a issue with validating the form.



I have a submit button on the last page and the click event checks for fields that needs validation. The issue is; since the fields being validated are on different pages (and are available only when we load that page), how can I get all the field and its associated values for validation on the submit click event.
3 Replies

Avatar

Former Community Member
Well, you must be preserving the data somewhere as you move around pages. So you'll need to script your validation against that location that has all the data rather than against the form DOM that only has the current page.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Hi Chris,



Thanks for the prompt response. I am using the "Model View Controller XFA Sample" on the following site : http://partners.adobe.com/public/developer/livecycle/designer/devcenter.html as a reference to create the above mentioned wizard type application.



As you rightly mentioned I am storing the data for each page in a javascript array named dataStore. I am able to access this variable on the click event of the submit button on the final page, but how do I use this variable to in the xfa.data.form1.loadXML() to get all the XML structure before I start validating the form?

Avatar

Former Community Member
Hi Chris,



I am able to create a variable that contains the xml form data from all pages using the following syntax.



var allData = dataStore["1"] + dataStore["2"];



But on the final page, when I click the Submit button, it only posts the xml data from the last page that was loaded. How do I "tell" click event to pass the xml from the allData variable?