Who is this article for?Users who want to learn about converting a Text Field to an Email.
No elevated access or permissions are required.
An Email field captures text that must be entered by the form filler as a properly formatted email address. This is used to capture one or more email addresses on a form, while automatically applying validation rules if an incorrectly formatted value is entered.
This article outlines the process of converting a Text Field to an Email.
1. Adding an Email field
To add an email field:
- Open Smartforms Designer.
- Drag Email from the list on the left.
- Drop it onto the design surface.
2. Setting Data Type
The difference between an Email field and a regular Single Line Edit field is in the Data Type property, which can be seen in the Properties panel on the right.
Setting the Data Type to Email will automatically apply the necessary validation rules to the field that require an email address to be entered.
Email validation does not check if the email address is correct/exists, it only checks whether it's formatted correctly.
3. Converting an Existing Field
In some cases, it may be necessary to convert an existing field to an Email field. This is most commonly done when updating a form template that was created prior to the availability of the Email field, prior to version 12.13.1.
The Primary Contact field was created as a Single Line Edit. The Data Type for this field is set to String which means it will accept any value.
To convert this field to an Email type, simply change the value in the Data Type dropdown to Email.
Modifying an existing field is preferred over removing the field and adding a new Email field for a number of reasons.
If there are custom validation rules or report bindings associated with the field, deleting the field will also remove those objects and they will need to be recreated.
Field ID should remain the same if the field is referenced in client or server script, or if the form template is configured to export to SQL.
Modifying the field in place ensures the Field ID does not change.
While Single Line Edit fields are most commonly used to capture email addresses, most field types can be configured to an Email data type in this same manner including Multi Line Edit, Dropdown, and Radio Button.