E
Ed Richter
I'm having some trouble validating a form. Below is a section of the validation script. There are about ten fields in the form, and a bunch of validation checks done on all of them. They all work fine except the last part shown below. (there are more checks in the actual script, I meant last one shown in this email listing)
When I ask to alert if the First_Official = Chase it doesn't do it. It just will accept any name in field whether it's Chase or something else and never alert me. If I leave field blank or use the first selection, it will alert me, so those other two checks associated with same field name are working, just not the check for "Chase"
I also tried changing the script to: if (checkName != "Chase") as a test. Then it would fail and alert me no matter what name was entered.
Anyone see anything wrong??
if (theForm.First_official.selectedIndex < 0)
{
alert("Please select a \"First Official\" option.");
theForm.First_official.focus();
return (false);
}
if (theForm.First_official.selectedIndex == 0)
{
alert("The first choice for \"First Official\" is not a valid selection. Please choose one of the other options.");
theForm.First_official.focus();
return (false);
}
// Section below not working
var checkName = theForm.First_official.value;
if (checkName == "Chase")
{
alert("The first official is Chase Please choose another names.");
theForm.First_official.focus();
return (false);
}
When I ask to alert if the First_Official = Chase it doesn't do it. It just will accept any name in field whether it's Chase or something else and never alert me. If I leave field blank or use the first selection, it will alert me, so those other two checks associated with same field name are working, just not the check for "Chase"
I also tried changing the script to: if (checkName != "Chase") as a test. Then it would fail and alert me no matter what name was entered.
Anyone see anything wrong??
if (theForm.First_official.selectedIndex < 0)
{
alert("Please select a \"First Official\" option.");
theForm.First_official.focus();
return (false);
}
if (theForm.First_official.selectedIndex == 0)
{
alert("The first choice for \"First Official\" is not a valid selection. Please choose one of the other options.");
theForm.First_official.focus();
return (false);
}
// Section below not working
var checkName = theForm.First_official.value;
if (checkName == "Chase")
{
alert("The first official is Chase Please choose another names.");
theForm.First_official.focus();
return (false);
}