Jump to content

Checkbox Array Function


justravis

Recommended Posts

First, i did not need to pass the form name to any of my other validation functions, but is it necessary when dealing with checkbox arrays?

 

Second, I tried 2 different approaches to figuring out if any checkboxes in the array are checked, but none of them work.

                                function check_req(form, field, alerttext)
                                {
                                        /*count_checked=0;

                                        for(i=1; i<field.length;i++)
                                        {
                                                if(field.checked==true)
                                                {
                                                        count_checked++;
                                                }
                                        }

                                        if(count_checked==0)*/
                                        if(form.field.checked==false)
                                        {
                                                alert(alerttext);

                                                return false;
                                        }
                                }

 

http://www.powerontechnologies.com/_sites/vsd/savy/savy.pwr

 

Any ideas?

 

THANKS!

Link to comment
https://forums.phpfreaks.com/topic/65463-checkbox-array-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.