Move To Previous Page
Definition:
NDLLibrary.moveToPreviousPage(ndlParams)
Description:
Moves to the previous page in the form.
Parameters:
Returns:
nothing
Code Sample 1:
This example shows the JavaScript statement which will appear in the JavaScript function generated from an Element's Event property where Move to next page is assigned to the Event:
return NDLLibrary.moveToPreviousPage(ndlParams);
Code Sample 2:
This example shows how to include a call to moveToPreviousPage 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 moveToPreviousPage. Note in the code sample below that you only need to include hash and form properties in your custom ndlParams; moveToPreviousPage 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,
};
return NDLLibrary.moveToPreviousPage(ndlParams);
Notes:
By default, you cannot move to another page unless all the pages before it are valid, even if you are moving 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. This is not an issue when moving forward through a form in sequence, going from page 1 to page 2 to page 3 etc. and you want to go back to view or edit the previous pages. Using Move to Previous Page can be used to move backwards as expected.
However, you can include nonsequential pages which can be accessed even if the intervening pages are invalid. If you call Move to Previous Page on a nonsequential page, it acts like a 'back' button and returns to the page which was displayed before the current nonsequential page, providing that involves moving backwards. If it would involve movement forwards or multiple nonsequential pages have been displayed one after another and Move to Previous Page has already been called (or a Previous Button has already been clicked or tapped) on the last of these nonsequential pages, the form will display the first invalid page it finds in the page sequence, starting from the beginning, which is before the page on which Move to Previous Page was called. If all pages in the sequence before the current page are valid, the form will move backwards to the previous page in the sequence.
Using as Predefined Action in Event:
When assigned to an Event as a predefined action, this function doesn’t require any editing.
See also: