Using script actions with form controls
Namo WebEditor’s collection of ready-to-use script actions includes several form-related script actions to perform such tasks as checking whether a specific field contains a numerical value or whether there are any empty fields, before sending form data to a form handler. You can associate these script actions with events such as exiting a text box or clicking a submit button. The available form-related script actions are as follows:
Script Action |
Description |
Can be attached to |
---|---|---|
Move Focus to |
Moves the keyboard focus to a specific form control. |
text boxes, hidden fields |
Reset Form Field |
Clears the contents of a specific text box. |
text boxes, drop-down menus, list boxes |
Select Text in Form Field |
Selects the contents of a specific text box. |
all controls except hidden fields and file browsers |
Validate E-mail Address |
Displays a pop-up message if the contents of a specific text box are not a valid e-mail address. |
one-line text boxes |
Validate Field Contains Number |
Displays a pop-up message if the contents of a specific text box are not a number. |
one-line text boxes |
Validate Field Not Empty |
Displays a pop-up message if a specific text box is empty. |
one-line text boxes |
Validate Length Not Exceeded |
Displays a pop-up message if the contents of a specific text box exceed a specified length. |
one-line text boxes |
Validate No Field Empty |
Displays a pop-up message if any text box in the form is empty. |
one-line text boxes, check boxes, radio buttons, push buttons, image controls |
To attach a script action to a form control
- Select the desired form control.
- On the Actions panel, click (Add). (If the Actions panel is hidden, press Alt+7.)
- Click the Action box and select the desired action.
- Click the Event box and select the event that should trigger the action.
- Under Parameters, confirm that the correct form is selected in the Form name box, and specify other parameters as required.
- Click OK.
To modify or remove a script action
- Select the form control to which the script action is attached.
- On the Actions panel, double-click the script action you want to modify, or select it and click (Remove).
Related topics
Working with actions and events