Cancel Submit
The cancel submit deluge statement is used in the Form
Action - Validate block to stop a form from being submitted.
Syntax
on submit { // specify validation code { // specify alert message if not valid and cancel the submission alert "age should be between 20 to 100"; cancel submit; }
|
Note: |
The alert message in 'on submit' will be invoked
only in the presence of a 'cancel submit'. In the absence of form
cancellation, the alert message is bypassed by Zoho Creator.
|
Examples
1. Alerts the message specified in quotes and cancels submission,
if the value entered in the age field is not between 20 and 100.
Age ( type = number ) on validate { if (input.Age < 20) && (input.Age >100) { alert "age should be between 20 to 100"; cancel submit; } }
|
2. The code snippet given below fetches the data corresponding
to the particular position applied by the applicant and checks if the
Status for that position is currently closed and displays an error message
to the user. You can access all the details related to that position
by accessing the variable “opening”.
on validate { opening = New_Opening [Position_Name == input.Applied_For]; if (opening.Status == “Closed”) { alert “The job profile ” + this.Applied_For + ” for which you have applied is not currently open “; cancel submit; } }
|
Cancel Submit seems to deactivate any further "on user input" field scripts. If a Cancel Submit occurs because a user failed to enter a required range in a field AND input into that field triggers a hide/show or enable/disable script necessary for the proper function of the form then Cancel Submit would force a reset and start over of the form. If there is a way to not deactivate filed scripts upon Cancel Submit then this page would seem like a good place to point that out.
I agree with this. I supposed actually that the Cancel button could bring the user to a different page or something like that. I do not see how this ought to work. Can anyone help me with this?
Kind regards