The alert keyword is used in the Form Action - Validate section to display a meaningful alert message while rejecting the Form submission. 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.
- value - the alert message to be displayed.
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 SkyDesk Creator.
- Alerts the message specified in quotes and cancels submission, if the value entered in the age field is not between 20 and 100.
type = number
if (input.Age < 20) && (input.Age >100)
alert "age should be between 20 to 100";
- 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”.
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 “;