How to use the pattern attribute, to specify regular expression to input value

The pattern attribute, when specified is a regular expression which the input value must match the value of pass constraint validation it must be a valid JavaScript regular expression as used by the reg exp type.The pattern attribute specifies a regular expression form control’s value should match. If a non-null value doesn’t conform to the constraints set by the pattern value,… Continue reading How to use the pattern attribute, to specify regular expression to input value

Form validation

Name pattern=”^[a-zA-Z]+(?:[_ -a-zA-Z0-9 !@#$%^&*|<>.,])*[a-zA-Z 0-9 !@#$%^&*|<>.,]*$” This pattern will satisfy the following conditions. The name accepts symbols (ex: Victoria 2) The name accepts combinations of alphabets and special characters (ex: Test Victoria ||| & Company). The name field does not accept all numerals. The name field does not accept all white spaces. The name field… Continue reading Form validation