Making a Field Required
Setting a field to Mandatory, forces the user to fill a value for the particular form field. When you make a field Mandatory, Zoho Creator won't let a user save the record until a value is entered in that field. Instead, the program displays a message telling the user Enter a value for <fieldname>.
To set a form field as mandatory while adding a field,
- Drag and drop the required field to the form.
- From the Field properties, select the check box Mandatory.
To set an existing field as Mandatory,
- Select the Form from the Dashboard in Edit mode.
- Select the field to be edited.
- Select Field Properties from the right pane and select the checkbox Mandatory.
- The changes made will be auto-saved.
Make a field to be “required” dynamically
Assume you have a radio button field named Field1 in your form with values “Yes”/ “No” and you want Field2 to be required only if the value of Field1 is “Yes”. To achieve the given scenario, add the given script to Form Actions ->On add ->validate section of the Script tab.
alert "Enter a value for field2";