PDA

View Full Version : Strange behaviour whan using a Form input mask



forum_amnesiac
04-23-2009, 01:13 PM
I am trying to use a JS mask to put the "/" in a date field.

This field also has an "onBlur" function that does various validation on the date.

I use "onKeyup" to use the mask as the user is typing the date.

I also place a default value of "jj/mm/aaaa" to the date field, ie dd/mm/yyyy in French.

My problem is when the focus is given to the input field for the date something strange happens.

The field flickers to highlighted, ie focus, and then is no longer highlighted. The cursor cannot be seen but is before the first character.

If any input is made it does appear at the start of the date input field but it doesn't of course overwrite the default because it is no longer highlighted.

Can anybody find me a solution to this problem, I know it may be something obvious to others but I've probably looked at it too long to be able to see the answer.

Here is a link to a sample page that displays this behaviour.

http://www.cognac-jaugeage.com/abctest.htm

PS I'm using IE 7