Validating checkbox

jpipitone 18 Jan, 2008
I've added this code to validate a checkbox, however i'm getting a javascript error "Object expected"

Can you help?

if(!document.form._1105media[].checked)      {
 alert("REQUIRED: Please check the email address 1105media."«»);
return false;
}
jpipitone 18 Jan, 2008
This also doesn't work:

if(!form._1105media[].checked)  {
 alert("REQUIRED: Please check the email address 1105media."«»);
return false; 
}
<br><br>Post edited by: jpipitone, at: 2008/01/17 22:40
jpipitone 18 Jan, 2008
This works:

if(!form.elements["_1105media[]"].checked) {
 alert("REQUIRED: Please check the email address 1105media."«»);
return false; 
}
GreyHead 18 Jan, 2008
Hi jpipitone,

Why not use the validation in ChronoForms?

Bob
This topic is locked and no more replies can be posted.