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 copy form data between different pages

1685


Create a ViewState Property?

2295


how to create a Custom Scrollbar

2056


How to encode and decode URL strings?

1802


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

1554






how to get the User's Time of Day

1677


program to bring a window to the front

1574


code to create a new window

1756


write a code to generate pseudorandom numbes

1793


I have a doubt regarding including tags in a function. I have written a function in javascript in a html page. The function got called by clicking a button, i want to display the results in same html page by placing tags in the function. (this hmtl page is static page) Is this possible? example: