Please note that the snippets in this article will only work for pages using the new and improved page generator, the Thor Rendering Engine. We recommend testing the snippet functionality in case your page was created before 2019 or duplicated from an older page, as the two render engines have a different code structure in the backend. To migrate your older pages to the new Thor Rendering Engine, you can contact our support team at email@example.com.
Our form fields have automatic validation built into them:
- If the field name contains the word "email", the input entered by the page visitor must follow the firstname.lastname@example.org format. Otherwise, the field will display an error message when they try submitting the form.
- If the field name contains the word "number", the input entered by the page visitor must be comprised only of numbers and punctuation/symbols. If letters are typed in, the field will display an error message when they try submitting the form.
In order for this validation to be active, you do not need to use any additional code, having the words "email" or "number" in the field name is enough, noting that this only applies to the words in English.
Can I remove this functionality?
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. For example, you might have a field named Identification number which includes letters, that the visitor must enter.