Often it is useful to define numeric fields in the database for information such as pricing or measurement. A numeric field holds only numbers. Zoho Creator does not allow any other characters to be input in a numeric field. The message Enter a valid number for <field name> will be displayed if a user submits the form with a non-numeric value in a Numeric field type. The max number of digits that can be entered into a numeric field is 10.
To enter values like telephone numbers, ID, zip code etc., it is always better to use a text field instead of a numeric field, as these may sometimes start with a zero. In case of numeric fields, Zoho Creator automatically removes the preceding zero.
A Form that displays the Numeric Field Types supported in Zoho Creator
Number:The Number field type holds plain numbers without any decimals, percentage or currency signs.
Decimal: The Decimal field type holds numbers with or without decimal places.
Percent: The percent field type holds numbers as a percentage, with or without decimal places.
Currency: The currency field type holds numbers in the specified currency format, with or without decimal places. The default currency symbol is the dollar sign ($).
The Number datatype is used in scripting for Numeric field type.
Setting a field to Mandatory, forces the user to fill a value for the particular form field.
To make a field mandatory through GUI, please refer the following link.
To make a field mandatory through script,
For example, the sample script shown below indicates the user that the field value is mandatory and requires data to be entered in the field.
In the above code, input.Age is the field where the field value is mandatory.
Now you can set a default value for a field in the form. There are two possible ways to perform this action.
To set default value for a field through GUI, please refer the following link.
You can use this option to set up dynamic values to fields. Setting today's date for a Date field, current time for a Date-Time field, logged in user's email for Email field are some examples.
This can also be used for the fields where you see the "Initial Value" option missing.
1. In the edit mode, click on workflow tab.
2. Go to On Add -> On Load script section of the Form.
3. Enter the code shown below and click on "Save script " button.
4. Now you can see the default value in the field while accessing the application.
Selecting a field value unique for a particular field will not accept any duplicate values while submitting the form. There are two possible ways to perform this action.
To set a field value as unique for a field, please refer the following link.
To make a field value unique in scripting,
The sample script shown below is an example for making a field value unique through scripting.
The permission option supports the show/hide functionality to create forms that hide the information from the user or adjust the fields while the user is entering the data . There are two possible ways to perform this action.
To enable the show/hide functionality from the GUI, please refer the following link.
In the Form Actions -> on add ->on load script of the form, hide the required fields,as shown in the below example.