An application that gives a free ride to input incorrect data is useless. So validating form inputs is one area that needs to be done carefully while creating applications. Zoho Creator allows you to accurately validate the form inputs and helps you to give clear feedback to the user when the form does not accept the data.
Here is an overview that will help you to utilize this feature in Zoho Creator to the fullest.
Validations during a form submit can be classified as
What really happens when you submit a form in Zoho Creator ?
Please note that the data gets persisted only if the on submit action does not get canceled.
Lets take a recruitment application for example to understand better. This sample recruitment application has just two forms
The on submit action that executed while submitting the "Post Application" form is given below.
| on submit { opening = New_Opening [Position_Name == $Applied_For]; if (opening.Status == "Closed") { alert "The job profile " + $Applied_For + " for which you have applied is not currently open "; cancel submit; } } |
The code snippet given below fetches the data corresponding to the particular position applied by the applicant. You can access all the details related to that position by accessing the variable "opening".
| opening = New_Opening [Position_Name == $Applied_For]; |
The code snippet given below checks if the Status for that position is currently closed and displays an error message to the user.
| if (opening.Status == "Closed") { alert "The job profile " + $Applied_For + " for which you have applied is not currently open "; cancel submit; } |
You can also read deluge help to learn more on scripting. Do try this feature and let us know your comments / suggestions.
Post Comment