Validate HTML Inputs w/ Pattern Attribute

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.

Industries

Creators

Have feedback or a question related to this item? Drop us some feedback!

Curated: 
5.4.23

Similar items

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

FROST

9.14.23

Kinetic Studio

9.14.23

Replit

9.13.23

Off Menu

9.13.23

Algolia

9.13.23

Off-Grid

9.13.23

Ophelia

9.13.23

Wix Studio

9.13.23

Dark/Light Mode Favicon Images

9.12.23

BEGG

9.12.23

Captions

9.12.23

Bayonet Media

9.12.23

Sabbath

9.12.23

ChatGPT

9.10.23

Finsweet Table

9.5.23

Dominique Sire

9.5.23

Somefolk

9.5.23

Remove https:// From Text Link

9.4.23

Wrapbook

9.1.23

Flowplay

8.31.23

ChainGPT

8.30.23

HeyFriends!

8.29.23

Bajgart Design Office

8.28.23

Rows

8.27.23

Move Agency

8.27.23

Rebrand

8.25.23

Navs.Supply

8.25.23

BuildBetter AI

8.25.23

Middesk

8.24.23

Webflail

8.23.23

deck․gallery

8.23.23

Bunsen Studio

8.21.23

The Digital Third

8.21.23

Cursor

8.19.23

TextFX

8.18.23

Strategyzer

8.18.23

toddle

8.17.23

Prismic

8.17.23

Diagram

8.17.23

Mbau

8.17.23

Thenty

8.17.23

Breeona Nechole

8.16.23

Ghost

8.16.23

SEARCH

8.16.23

Minerva

8.15.23

Modyfi

8.14.23

Framer University

8.14.23

Artifact

8.14.23

Sundown Studios

8.11.23

Sneaps

8.10.23

Hireguide

8.10.23

Splide

8.10.23
Load more

Bummer, no results

Try a different search/filter combo, or drop us some feedback if there is something missing you would love to see!

Reset filters

Subscribe for updates

Get updates on the latest curated resources and be the first to hear of new features.