hub.eb?material_id=276

Before Page Event


The Before Page event is triggered each time an end-user navigates to the Page.

Here are a few examples of actions you might perform in a Page's Before Page event:

  • Fetch data used on a particular Page.
  • Set up some preliminary data.
  • Adjust Controls on the Page.
  • Check user security settings.
  • Redirect the user to a different Page.

Steps


1

Create a Form and add a Field called myField. Drag the Field onto the Page and name the Control myFieldControl.

2

Right-click on the Page in the Pages tab and select Events. Under Before Page, click the button to create a new Script. Name the script setMyField.

3

Add the following to the new setMyField script:

fields.myField.value = "Hello, world.";
controls.myFieldControl.setDisplayOnly(true);
4

Return to the Form and run it.

Note that myField has been set and myFieldControl is no longer editable.

Part of tracks

Related