Link to home
Start Free TrialLog in
Avatar of Crystal Rouse
Crystal RouseFlag for United States of America

asked on

Form Text Field Input Mask

I need to create JavaScript validation for a form input text field.

The format of the text should be:

AB18-1234

It's been awhile since I've done this so I need some quick pointers to get me started.
Thank You!
SOLUTION
Avatar of Camillia
Camillia
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Crystal Rouse

ASKER

If I'm understanding Regular Expressions, I have:

\D{2}+[0-9]{2}-?\d{4}$

Do I need to include ^ to start the line?
What is the symbol for a number only, special character such as a hyphen?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sunil Kumar
Sunil Kumar

Please check the below given link may be it will be helpfull for you.
https://www.npmjs.com/package/Click Hereinputmask

regards
php interview questions