/html-pattern-attributes.html Secret
Created
May 8, 2023 14:43
Star
You must be signed in to star a gist
Validate HTML Inputs w/ Pattern Attribute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Example: validate for specific URL (one that ends in .webflow.io) --> | |
<input type="url" id="site" name="site" pattern="(https://)+[a-zA-z0-9-/:]+(.webflow.io)+/?" title="Enter a webflow.io URL"> | |
<!-- Example: validate for specific email (one that ends in @example.com) --> | |
<input type="email" id="email" name="email" pattern="^[A-Za-z0-9._%+-]+@example\.com$" title="Enter a valid email address"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment