HTML Form Validation Examples

Note: These forms all use "echo.php" as the action. This PHP script will just echo the name=value pairs that it receives.

Using the Proper Input Type

Date



Using Attributes to Validate Input

Text Box with maxlength, required, placeholder


Date with datemax, datemin





Using pattern for regex