Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Validate HTML Inputs w/ Pattern Attribute
<!-- 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