Couple of questions
| From: | John Nichel | Date: | Thu, 24 Oct 2002 17:46:04 +0000 |
| Subject: | Couple of questions | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-121321@lists.php.net to get a copy of this message | ||
Hi guys and gals,
I know this list is for php, but I've been trying to find an answer to
a JavaScript releated question for the past two day, and there has been
no response on the two JS mailing lists I belong too. I have two
questions....
1) Does anyone know of a JS mailing list that actually has a good
amount of traffic (receives more than 10 email messages a day)?
2) I'm trying to validate a checkbox element in a form. Due to using
php to process this form, the checkbox element must have a name ending
in square brackets...
<input type="checkbox" value="somevalue" name="somename[]" />
The problem I'm having is trying to loop thru this element to see if at
least one of the boxes are checked....
for ( i = 0; i < document.forms[0].elements['somename[]'].length; i++ )
{
alert ( document.forms[0].elements['somename[]'][i].checked );} This gives me an error. What's the proper syntax for this?