hub.eb?material_id=117&track_id=350

Go to Form


The Verj.io JavaScript API's form interface includes a form.gotoForm("myForm") function that navigates to the specified Form.

Optionally, an object containing parameters can be provided. This object must be made up of key-value pairs:

  • keys must be the names of URL Parameter Fields on the destination Form.
  • values to be automatically inserted into those Fields.
var params = {
  name: fields.name.value,
  age: fields.age.value,
  verified: true
};

form.gotoForm("mySecondForm", params);

Using gotoForm() invalidates the current User Session and starts a new session for the destination Form. Any Field values on the original Form are cleared and cannot be retrieved.

Steps


1

Create two Forms and name them first and second.

2

Add a Button Control to the first Form's Page with the text: Go to Second Form.

Create a Script containing the following code and add it to the Button Control's On Click Event:

form.gotoForm("second")
3

Add a Field called myField to the first Form and drag it on to its Page as a Field Control.

4

Add a Button Control to the second Form's Page with the text: Go to First Form.

Create a Script containing the following code and add it to the Button Control's On Click Event:

form.gotoForm("first")
5

Run the first form and add a value to the Field.

Clicking the buttons will navigate between the Forms. Note that, on returning to the first Form, the initial state has been lost and the Field value has been reset.

Current Module

Related