Allow only numeric values in textbox not working in Firefox
Posted
by AsM
on Stack Overflow
See other posts from Stack Overflow
or by AsM
Published on 2010-06-01T06:19:11Z
Indexed on
2010/06/01
6:23 UTC
Read the original article
Hit count: 209
firefox
I have one Textbox accepting Bank A/c Number value which should be numerical only. I have written one javascript function for this as follows.
function fncInputNumericValuesOnly() { if(!(event.keyCode>=48||event.keyCode<=57)) { event.returnValue=false; } }
This code is not allowing non-numerical values in IE. but same is not working in Firefox. I also tried to use onkeyup event. & also tried on pageload txtAccountNumber.Attributes.Add("onkeyup","fncInputNumericValuesOnly()")
Why this is not working with firefox 3.
© Stack Overflow or respective owner