Allow only numeric values in textbox not working in Firefox
- by AsM
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.