Single-line text field validation in forms

Form Field Validation

The Validation feature includes different types of validation options which can be applied across different types of form fields, such as Custom, Numbers only, Letters only, URL format, Email, Alphanumeric, etc.

validation.png

For example, if you have a form field called "Age" you may want to apply a "Numbers only" validation to that field to ensure that no letters or other punctuation can be entered in your "Age" field. 

field validation.gif

Number Validation

If a single-line text field contains the words "number" in its name, automatic validation will be applied to it. It will only allow numbers and punctuation/symbols. If letters are typed in, the field will display an error message when the visitor tries to submit the form.

Email Validation

The Email field has 'Email Validation' enabled by default. Having this Email Validation enabled ensures that the input entered by the page visitor must be comprised of the name@domain.com format. If an email address format is not typed in, the field will display an error message when the visitors try to submit the form.

Can I remove auto-validation?

Yes. There might be situations where your use case for the form requires it, so you can use the code snippet below in order to disable the automatic validation.

Note: The code will not work for the Phone number field. We recommend using a different field if you do not require strictly numbers to be added in that field.

Add the code snippet below in the Settings > Javascript > Footer section. You will need to change the field names in the first line of the code to match your own fields. Make sure that each field name is between single quotes and written exactly as it is in the form, with the proper capitalization and without extra spaces.

NOTE: If you are using multiple forms on the same page and they have different fields, enter all the targeted field names from all of the forms in the same line. Do not paste the code multiple times.