# Checkbox validation

**URL:** <https://forum.kirupa.com/t/checkbox-validation/10511>\
**Category:** flash\
**Created:** [January 2, 2003, 3:08pm UTC](https://forum.kirupa.com/t/checkbox-validation/10511 "2003-01-02T15:08:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![garem](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@garem](https://forum.kirupa.com/u/garem)\
**Post date:** [January 2, 2003, 3:08pm UTC](https://forum.kirupa.com/t/checkbox-validation/10511/1 "2003-01-02T15:08:50Z")

</div>

Is there any way to validate several custom checkboxes (smart clips) to make sure that at least one is checked?

Please Help!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 3:20pm UTC](https://forum.kirupa.com/t/checkbox-validation/10511/2 "2003-01-02T15:20:32Z")

</div>

many ways to do that… if you want to make sure that one or more are checked, one way is to simply assign a numerical value to a variable. You can start with the variable at 0

myvalue=0

if a box is checked myvalue+=1.

later on, you can check to see if myvalue\>=1 that way you will know if one or two or three boxes have been checked simply by checking on the value of your variable. Does that make sense?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 4:02pm UTC](https://forum.kirupa.com/t/checkbox-validation/10511/3 "2003-01-02T16:02:11Z")

</div>

Thanks, but I cannot change the variable to numerics. I need to use the true and false.

The database it is going to is very picky.

Is there a way that will work with code similar to:

on (press) {

```
if (!firstname.length) {
    loadMovie("fname-error.swf", 1);
} else if (!lastname.length) {
    loadMovie("lname-error.swf", 1);
} else if (isNan(day_telephone)) {
    loadMovie("phone-error.swf", 1);
} else if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
    loadMovie("email-error.swf", 1);
} else {
    getURL("http://www.url...", "_blank", "POST");
}

```

}
