Creator Help

Configuring a Email Field

Table of Contentsup

Overview

The Email field is used to enter an email address. If you define a field to be of type Email,  Zoho Creator checks if the data entered in the form for that field is a valid email-id, else it will display the error message "Enter a valid email address for <field name>" to the user. The email-id submitted through a form is displayed as a link in the view. When you click on the link, Zoho Creator opens your email client with a blank message addressed to the specified email address.

Screen-shot of a Form with Email Field type and its view that displays the Email as a link


Configuring a Email field

Drag-n-drop the Email field type to the editor area as shown below.

In the Field Name textbox shown in the field properties below, specify the name that will be displayed for this field in the Form. The Deluge name of the field will be same as the field name with underscore instead of white spaces, and will be assigned automatically by Zoho Creator.

Specify the field configurations if required. Refer the topic Field Configurations to learn more about each configuration.

To edit the field configurations or to delete the field or to add field action scripts, select the field and make the changes in the Field Properties. All the chages you make will be auto saved.

When you Access the application, the Email field will be displayed to enable users to type in their email id.

Data type in scripting

The String datatype is used in scripting for Email id.

Validation

Make Field Mandatory

Setting a field to Mandatory, forces the user to fill a value for the particular form field. 

GUI

To make a field mandatory through GUI, please refer the following link.

Script 

To make a field mandatory through script,

  • Go to edit mode of the application.
  • Click on the Form Actions --> On validate from the workflow tab.
  • Enter the code and click on "Save script " button.
  • The mandatory option is now enabled for the particular field.

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.

if ( (input.Email == "") )
{
alert "Please enter the email id";
cancel submit ;
};

In the above code, input.Email is the field where the field value is mandatory.

Set default value 

Now you can set a default value for a field in the form. There are two possible ways to perform this action.

GUI

To set default value for a field through GUI, please refer the following link.

Script

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.

    input.field name = input.value

4. Now you can see the default value in the field while accessing the application.

Make a field value unique

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.

GUI

To set a field value as unique for a field, please refer the following link.

Script

To make a field value unique in scripting,

  • In the edit mode, click on workflow tab.
  • Select Form actions--> On Add -> On submit .
  • Enter the code and click on "Save script " button.
  • Now access the application.

The sample script shown below is an example for making a field value unique through scripting.

if(count(Contacts[Name == input.Name &&Email == input.Email]) >0)
{
alert “Contact ” + input.Name + “|” + input.Email ” already exists”;
cancel submit;
}

Permission

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.

GUI

To enable the show/hide functionality from the GUI, please refer the following link.

Script
  • Go to  Form Actions -> on add ->on load .
  • Enter the code and click on "Save script " button.
  • Now access the application to find the changes made in the script section.

In the Form Actions -> on add ->on load script of the form, hide the required fields, for example, Field 1 and Field 2 by adding the following piece of code as shown below.

hide <field name>;

Make Field Mandatory

Setting a field to Mandatory, forces the user to fill a value for the particular form field. 

GUI

To make a field mandatory through GUI, please refer the following link.

Script 

To make a field mandatory through script,

  • Go to edit mode of the application.
  • Click on the Form Actions --> On validate from the workflow tab.
  • Enter the code and click on "Save script " button.
  • The mandatory option is now enabled for the particular field.

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.

if ( (input.Product == "") )
{
alert "Please enter the value for the field";
cancel submit ;
};

In the above code, input.Product is the field where the field value is mandatory.

Set default value 

Now you can set a default value for a field in the form. There are two possible ways to perform this action.

GUI

To set default value for a field through GUI, please refer the following link.

Script

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.

    input.field name = input.value

4. Now you can see the default value in the field while accessing the application.

Make a field value unique

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.

GUI

To set a field value as unique for a field, please refer the following link.

Script

To make a field value unique in scripting,

  • In the edit mode, click on workflow tab.
  • Select Form actions--> On Add -> On submit .
  • Enter the code and click on "Save script " button.
  • Now access the application.

The sample script shown below is an example for making a field value unique through scripting.

if(count(Contacts[Name == input.Name &&DOB == input.DOB]) >0)
{
alert “Contact ” + input.Name + “|” + input.DOB ” already exists”;
cancel submit;
}

Permission

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.

GUI

To enable the show/hide functionality from the GUI, please refer the following link.

Script
  • Go to  Form Actions -> on add ->on load .
  • Enter the code and click on "Save script " button.
  • Now access the application to find the changes made in the script section.

In the Form Actions -> on add ->on load script of the form, hide the required fields, for example, Field 1 and Field 2 by adding the following piece of code as shown below.

hide <field name>;

Set Maximum Limit

Maximum number of fields in a form depends on the type of fields used and the maximum length of the field. Below are the limitations related to Single Line text field type.Form can have maximum of 80 text fields with max length of 255(SingleLine). This can be increased by reducing the max length value.

- See more at: /creator/help/fields/configuring-a-text-field.html#sthash.XfJ09iac.dpuf

Make Field Mandatory

Setting a field to Mandatory, forces the user to fill a value for the particular form field. 

GUI

To make a field mandatory through GUI, please refer the following link.

Script 

To make a field mandatory through script,

  • Go to edit mode of the application.
  • Click on the Form Actions --> On validate from the workflow tab.
  • Enter the code and click on "Save script " button.
  • The mandatory option is now enabled for the particular field.

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.

if ( (input.Product == "") )
{
alert "Please enter the value for the field";
cancel submit ;
};

In the above code, input.Product is the field where the field value is mandatory.

Set default value 

Now you can set a default value for a field in the form. There are two possible ways to perform this action.

GUI

To set default value for a field through GUI, please refer the following link.

Script

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.

    input.field name = input.value

4. Now you can see the default value in the field while accessing the application.

Make a field value unique

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.

GUI

To set a field value as unique for a field, please refer the following link.

Script

To make a field value unique in scripting,

  • In the edit mode, click on workflow tab.
  • Select Form actions--> On Add -> On submit .
  • Enter the code and click on "Save script " button.
  • Now access the application.

The sample script shown below is an example for making a field value unique through scripting.

if(count(Contacts[Name == input.Name &&DOB == input.DOB]) >0)
{
alert “Contact ” + input.Name + “|” + input.DOB ” already exists”;
cancel submit;
}

Permission

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.

GUI

To enable the show/hide functionality from the GUI, please refer the following link.

Script
  • Go to  Form Actions -> on add ->on load .
  • Enter the code and click on "Save script " button.
  • Now access the application to find the changes made in the script section.

In the Form Actions -> on add ->on load script of the form, hide the required fields, for example, Field 1 and Field 2 by adding the following piece of code as shown below.

hide <field name>;

Top