Buy Now
Sign in

Validating checkbox

jpipitone , January 18 2008, 03:37
J
jpipitone 36
January 18 2008, 03:37 #5003
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;
}
J
jpipitone 36
January 18 2008, 03:40 #5004
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
J
jpipitone 36
January 18 2008, 03:45 #5006
This works:

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

Why not use the validation in ChronoForms?

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much