Menu

#3 Integer Only Validator only works on IE

open
nobody
None
5
2006-12-28
2006-12-28
No

The 'Integer Only Validator' doesn't work in FireFox (tested on 2.0.0.1), it seems to work only in IE (tested on IE 6).

The problem is the way the keyboard event is treated. Attached is a fix to make it work in both Firefox and IE.

The only change when using it is to pass a new argument. Thus, to use it you should do it as 'keyPressNumber(false, event);'.

Discussion

  • Luis Parravicini

    Patch to use the validator in Firefox

     
  • Luis Parravicini

    Logged In: YES
    user_id=408834
    Originator: YES

    It was tested against clientvalidators 0.9.1

     
  • Luis Parravicini

    Logged In: YES
    user_id=408834
    Originator: YES

    The way 'keyPressNumber' is cheking the keyCode makes the valid chars the only available. i.e.: in FireFox backspace is disabled (you can enable that by checking if the keyCode is 8).

     

Log in to post a comment.