Validate HTML Inputs w/ Pattern Attribute

Add a simple pattern and title attribute on any HTML input to only allow a specific value or part of a value to be accepted. This can be used to validate emails from a specific domain like “@example.com” or only accept links that include a specific string. The title attribute allows a custom message appear in a browser default tooltip if the email entered isn’t valid.
Within the pattern attribute we use regex to determine what value match is approved. You can use regex to match just about anything, so this general approach can also be used to match other specific values in any input.
Tags
Creator
Share this item
Have feedback or a question related to this item? Drop us some feedback!
Redirect Form on Submit and Pass Input Value to URL
Detect and Don't Redirect Search Bots
Get Website Meta Data w/ Airtable Script
Get YouTube Thumbnails w/ Airtable Script
View All or Show Less List Pagination
Subscribe for updates
Get updates on the latest curated resources and be the first to hear of new features.
SubscribeStyle, type, and motion in harmony, architectural web glory, AI your brand
When AI becomes your copilot, make sure you still know how to fly the plane.
Featured inspo