validation code / function to allow only NUmbers in a text box

Answer Posted / satish reddy

function isNumeric(keyCode)

{

if(keyCode==16)

isShift = true;



return ((keyCode >= 48 && keyCode <= 57 || keyCode ==
8 ||

(keyCode >= 96 && keyCode <= 105)) && isShift
== false);

}

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to encode and decode URL strings?

1795


write a code that user can choose/alter Body Text Size

1608


code to get the coordinates of a Click Event

1741


sample code to auto focusing the first field in a form

2033


code to create a new window

1754






maximizing the main window

1634


snippet to prevent submission of form when certain/any validations got failed

1548


communication between main window and new windows

1701


how to transform XML Data into HTML

1900


function to combine two or more arrays

1701


program to bring a window to the front

1568


code to detect availability of cookies

1786


how to convert between arrays and strings

2109


how to pass data between pages using Cookies

1850


create Drop-Down Navigation Menus

1705