Validate Number JS
Make sure Numbers entered into form fields are valid.
function CheckNumb(THISNUMB) { //Copyright © 2002 Booshway Enterprises, Inc. all rights reserved var err=0; if (THISNUMB.value == "") { alert("Please enter a value for " + THISNUMB.name + " field."); THISNUMB.focus(); err=1; return (err); } var checkOK = "0123456789.-"; var checkStr = THISNUMB.value; var found = false; for (i = 0; i < checkStr.length; i++) { found = false; ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) { if (ch == checkOK.charAt(j)) { found = true; break; } } if (!found) { alert("Please enter only digit characters in " + THISNUMB.name + " field."); THISNUMB.focus(); err=1; break; } } return (err); }