I adverntyly sent the wrong script with the last post.I am new to JavaScript and need some help. I am using some script that I got off this forum. The following is supposed to validate a checkbox. I have this in a page with the js extension.
function validateTreatment(fld, errMsg)
{
for (index = 0; index < fld.length; index++)
{
if (certs[index].checked)
return true;
}
alert("Please select at least one choice for " + errMsg + ".");
fld[0].focus();
return false;
}//endfunction validateTreatment
I have the following as part of my function in the js header
else if (validateTreatment(f.txtConsult, ‘Please Enter a Treatment’) == false)
return false;
I get the following error. Certs undefined. I am not sure what certs is doing. Should it be declared? Thanks for your help.
function validatePCP(fld, errMsg)
{
if(fld.value==“”)
{
alert("Please enter a value for " + errMsg + “.”);
return false;
}//endif
return true;
}//endfunction validatePCP