0

im not sure if this is possible but I want an input box where the user can only type in the following pattern: (Number)(-)(Number)(Number)(Letter)

The user cannot type anything else but this pattern. Any leads would be appreciated

David Osborne
  • 6,436
  • 1
  • 21
  • 35

1 Answers1

0

You can do this with a regex (what you specify in the "pattern" value):

<input type="text" pattern="regex comes here">

And in your case i believe you will need this regex:

[\d][-][\d][\d][a-zA-Z]
tsgr
  • 3
  • 6