After opening the editor, click on function MFAfterOpen() in the Events window in the top right side of the script editor.
Within the function, you will need to enter the following command:
_Form.pageHidden(int pageNumber, boolean value)
So to hide page two of the form, the designer would enter:
The screenshot below demonstrates the hiding command:
To have the pages become accessible again, use the same line of code, but now change the boolean value from value from true to false. Common places to place the unhide command would be in hotspots, picklist choices, or after certain data fields have been filled.
Another way to accomplish locking a certain number of pages would be with a simple for loop, as shown below:
Hiding pages can also be done in VB.Net for Windows based Mi-Forms. The biggest difference to remember when hiding pages in VB.Net is that the index for the pages starts at 0 and not at 1.
To start, open the .Net script editor and select the AfterOpen method from the Events window:
Here, use the following expression to hide the desired pages, filling pageNumber with the desired page and value with the desired Boolean status:
_Form.Pages(int pageNumber).Hidden = Boolean value
Don’t forget that .Net indexing starts at 0! An example is below:
To unhide the form, simple change the Boolean value from true to false:
_Form.Pages(1).Hidden = False