-2

I have a text box which has the place holder within as __-__-__ ("_" denotes a number) When I type in the box, it is entered as 123456. I need it to be entered as 12-34-56 (without manually adding the "-" character)

<input type="text" placeholder ="__-__-__" id="number"/>
Zeeshan Ahmad Khalil
  • 793
  • 1
  • 12
  • 29
Tsu
  • 33
  • 4

1 Answers1

0

You can use cleave.js to format inputs

https://nosir.github.io/cleave.js/

Cristian
  • 44
  • 6