PHP Form Validation Example
* required field.
Your Input:
The validation rules for the form above are as follows:Field | Validation Rules |
---|---|
Name | Required. + Must only contain letters and whitespace |
Required. + Must contain a valid email address (with @ and .) | |
Website | Optional. If present, it must contain a valid URL |
Description | Optional. Multi-line input field (textarea) |
Gender | Required. Must select one |
Text Fields
The name, email, and website fields are text input elements, and the comment field is a textarea.Name: <input type="text" name="name"> E-mail: <input type="text" name="email"> Website: <input type="text" name="website"> Description: <textarea name="description" rows="4" cols="30"></textarea>
Radio Buttons
The gender fields are radio buttonsGender: <input type="radio" name="gender" value="female">F <input type="radio" name="gender" value="male">M

Views All Time
321

Views Today
4