tags:

views:

37

answers:

1

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.

A: 

Instead of event.returnValue=false; try return false; See this for a difference between the two.

nc3b