Wednesday, July 22, 2009

JavaScript Code for filtering Non Numeric Value

CODE:


function filterNonNumeric(field) {
var result = new String();
var numbers = "0123456789";
var chars = field.value.split(""); // create array
for (i = 0; i < value =" result;">

......The above code filter the non numeric value .........i.e, when ever user enter the value other than numeric it wont allow you to enter it accepts only the numeric value
.....the input for the above java script function is property/ name from the Textbox in Jsp

for ex..from jsp (please ignore the starting symbol(--) in tag


<--input type=text name="units">

the above name units is given to that function.
having doubt on this .......leave .....a..comment
Thanks
A.T.J


No comments:

Post a Comment