Create padLeft function with keyup

Asked

Viewed 38 times

1

I am trying to create a function where the user informs a 6-digit number + the year

For example:

  • If I type: 12016 => 000001/2016
  • If I type: 122016 => 000012/2016
  • If I type: 1232016 => 000123/2016
  • If I type: 12342016 => 001234/2016

And then I have to put a bar before the last 4 numbers to consider as the Year.

https://jsfiddle.net/al_unser/67o0oqn4/2/

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.