Click to See Complete Forum and Search --> : get value in form with name as fieldname[]


snoopy0877
09-22-2003, 11:23 PM
In php file, I have 3 checkbox input name as color[]:
<input name=color[] value=1> Red
<input name=color[] value=2> Green
<input name=color[] value=3> Blue

I want to use javascript to check user must check at least one Color. But I can't check by this syntax (color[].value=="")

Can you show me how? Thanks

DaiWelsh
09-23-2003, 05:51 AM
use the form

document.formname['color[]']

instead of

document.formname.color[]

and it should work.

HTH,

Dai

snoopy0877
09-24-2003, 11:49 PM