Hello,
I am trying to make use of the following:
function checkIt(){
if (document.PRODADD.AttributeValue[1].value == "") { //validate month
select
alert("Please select an option!");
document.myForm.ExpMonth.focus();
return false;
}
if (document.PRODADD.AttributeValue[41].value == "") { //validate year
select
alert("Please select an option");
document.myForm.ExpYear.focus();
return false;
}
return true;
}
And then later of course is:
<FORM NAME="PRODADD" METHOD="post" ACTION="../prodadd.asp" onsubmit="return
checkIt();">
The first problem is that javascript does not seem to like
AttributeValue[1]
AttributeValue[41]
Those are the select names in the form as in:
<SELECT NAME="AttributeValue[41]">
The [ and ] characters seem to be causing a choke. If I remove them from
the javascript function and the select names it works. If I put them back
I get this error:
document.PRODADD.AttributeValue.1 is null or not an object.
I *have* to keep those brackets in the select name area of the form. I
assume it is a matter of changing the syntax up in the function to properly
"see" them?
Problem #2 is that even when the function works the form submits as soon as
you OK the alert popup. How do I halt that?
Thank you very much.