Hi, I have the following java function that validate the form for numerical values:
and the following form:
I could not find the reason why this is not working. Can anyone help?
Code:
function validate_numeric(field, alerttxt)
{
with (field)
{
var strValidChars = "0123456789";
var strChar;
var blnResult = true;
for (i = 0; i < value.length && blnResult == true; i++)
{
strChar = value.charAt(i);
if (strValidChars.indexOf(strChar) == -1)
{alert(alerttxt);blnResult = false}
}
return blnResult;
}
}
and the following form:
Code:
function validate_form4(thisform)
{
with (thisform)
{
if (validate_numeric(NO_OF_TESTERS,"Please enter a numerical value")== false)
{NO_OF_TESTERS.focus();return false}
}
}
I could not find the reason why this is not working. Can anyone help?