Data Validation for HTML
Validate most user data from your HTML forms.
|Specifies whether a form field is required for submission. Add required to your input field.
|Set the minimum and maximum length for text input
|Set the minimum and maximum values for numerical input
|Specify the data type:
|Specifies a regular expression that defines the pattern for the form field data
Error MessagesIf you'd like to show a more specific error message when the user enters an invalid value or fails to enter a required field, you can add a title attribute and/or the pattern to match in with the required attribute.
<input type="text" name="vars[first_name]" required title="Enter your first name" />