I am currently struggling with a really really strange issue.
- I have a telephone number form field
- There's a function that fires onblur and validates whether the value is valid or not
- Every second time I do a blur, it validates as false, even if the value is correct and the value hasn't changed!
I have set up a small test case: http://jsfiddle.net/U3jwx/2/
Just click into the field and afterwards outside it - multiple times!
How can that be? The value does not even change! I suppose it has something to do with the validation function...
reset your regular expression's lastIndex to 0 between calls.