Hi Gurus
In my quest in putting my first javascript together, I am now trying to
conquer something that seems trivial, but has taken me hours.
I would like to format a field in a form once the person has completed it.
The format should be "00". For example, if the person puts 1 then it should
become 01 and if the person puts 12 in the field then it should stay like
that. If the person puts 2004 then it should become 04, and if the person
puts 012 then it should become 12.
At the same time, it would also be cool if we can warn the user that it
should only contain numbers [0-9].
Tia
- Nicolaas
In my quest in putting my first javascript together, I am now trying to
conquer something that seems trivial, but has taken me hours.
I would like to format a field in a form once the person has completed it.
The format should be "00". For example, if the person puts 1 then it should
become 01 and if the person puts 12 in the field then it should stay like
that. If the person puts 2004 then it should become 04, and if the person
puts 012 then it should become 12.
At the same time, it would also be cool if we can warn the user that it
should only contain numbers [0-9].
Tia
- Nicolaas
Comment