Hi,
I’m having problems with the following script:
What does the following refer to??? And why is there no 20??
objform[19].
objform[21].
objform[22].
objform[23].
thanks for an explanation
Theodore
<!–Begin pop-up field script – when user clicks Ok script automatically
defaults to the next required field.–>
<SCRIPT language=javascript>
<!–
function setInvoiceno(num)
{
document.forms[“form”].Invoiceno.value = num;
}
function CheckFields(objform){
if(objform.Cardname.value==””)
return _Alert(objform.Cardname,”Name may not be empty.”);
if(objform.Address.value==””)
return _Alert(objform.Address,”Address may not be empty.”);
if(objform.City.value==””)
return _Alert(objform.City,”City may not be empty.”);
if(objform.State.selectedIndex == 0)
return _Alert(objform.State,”Please select State/Province.”);
if(objform.Zip.value==””)
return _Alert(objform.Zip,”Zip may not be empty.”);
if(objform.Phone.value==””)
return _Alert(objform.Phone,”Phone may not be empty.”);
if(!emailCheck (objform.Email.value))
{
objform.Email.focus();
return false;
}
if(objform.Email.value != objform.Email2.value)
return _Alert(objform.Email2,”Email address must be identical to the above one.”);
if(objform.CardType.selectedIndex == 0)
return _Alert(objform.CardType,”Please select Credit Card Type.”);
if(objform.Cardnum.value==””)
return _Alert(objform.Cardnum,”Card Number may not be empty.”);
if (validateCard(objform.Cardnum.value) == false)
return _Alert(objform.Cardnum,”The credit card number is invalid.”);
if(objform.ExpDate_Month.selectedIndex == 0)
return _Alert(objform.ExpDate_Month,”Please select Credit Card Expiration Month.”);
if(objform.ExpDate_Year.selectedIndex == 0)
return _Alert(objform.ExpDate_Year,”Please select Credit Card Expiration Year.”);
if(objform[19].checked || objform[21].checked || objform[22].checked){}
else
return _Alert(objform[19],”Please choose the program.”);
if(objform[23].checked)
{}
else
return _Alert(objform[23],”You must read and agree to the Purchase Agreement.”);
return true;
}