Creator Help

Alert

Table of ContentsDown

Description

The alert keyword is used in the Form Action - Validate block to display a meaningful alert message when the form data is not submitted. The alert message gives a clear feedback to the user as to why the form does not accept the data. The message must be of type string enclosed within "" and will get displayed in the bottom part of the form.

Syntax

alert <value>;

where,

  • value - the alert message to be displayed.

Note:

  • The alert message in 'on validate" 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;
    }
    }

Top