Move To Page
Definition:
NDLLibrary.moveToPage(ndlParams, pageName)
Description:
Display the specified page of the form.
Parameters:
moveToPage requires a second parameter in addition to the default ndlParams object:
pageName - Required
The name of the page to display as specified in the page's Code Name property. The name is case-sensitive.
Note: For reasons of backwards compatibility, you can specify the page name as it appears in the page's Name property instead.
Returns:
nothing
Code Sample 1:
This example shows how you need to edit the JavaScript which will appear in the JavaScript function generated from an Element's Event property where Move to page is assigned to the Event:
var pageName = "contactDetails";
return NDLLibrary.moveToPage(ndlParams, pageName);
Code Sample 2:
This example shows how to include a call to moveToPage in your own JavaScript function, which isn't generated from an Element's event property. In this case you will need to create an ndlParams object to pass to moveToPage. Note in the code sample below that you only need to include hash and form properties in your custom ndlParams; moveToPage doesn't use the other properties found in the default ndlParams object and so these properties are not added here:
var ndlParams = {
"hash": window.location.hash,
"form": form1,
};
var pageName="contactDetails";
return NDLLibrary.moveToPage(ndlParams);
Notes:
By default, you cannot move to another page unless all the pages before it in the page sequence are valid, whether you are moving forwards or backwards. A page is valid if all Elements on the page which have one or more validation rules specified have been completed satisfactorily or the page has no validations specified. If you want to be able to jump to a page out of sequence, i.e. where pages before it are not valid, you will need to mark the page as nonsequential, which is done using the Nonsequential property in the page properties. If you have marked a page as nonsequential, you can use Move To Page to jump to the specified page even if the pages before it are not valid. One use of this feature would be to provide help pages which you want the user to be able to access at any point within the form.
Using as Predefined Action in Event:
When assigned to an Event as a predefined action, you will need to generate a JavaScript function and then edit the skeleton script created to place the name of the required page into the pageName parameter. Edit the automatically generated code:
return NDLLibrary.moveToPage(ndlParams);
so it matches the two lines shown in Code Sample 1 above, substituting the actual name of the page you want to move to in place of contactDetails, leaving the double quotes around it. Alternatively you can enter the page name directly in the function call, as follows:
return NDLLibrary.moveToPage(ndlParams,"contactDetails");
Note that if you enter the page name directly, it must be surrounded by double quotes.
See also: