Re: checkboxes problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Lynch wrote:
> 
> On Wed, May 30, 2007 3:59 am, blueboy wrote:
>> Hi,
>>
>> I have a checkbox array (about 20 lines)
>>
>> input name=\"box\" type=\"checkbox\" value=\"$id\">
>> input name=\"box\" type=\"checkbox\" value=\"$id\">
>> input name=\"box\" type=\"checkbox\" value=\"$id\">
>>
>> I do some client side checking with javascript however the javascript
>> array
>>
>> name=\"box\"
>>
>> does not match the php version,
>>
>>  name=\"box[]\"
>>
>>  So either my client side stuff works or the php array only returns 1
>> value
>> when posted. Is there any way to for this to work?
> 
> Let PHP use the NAME= attribute, and JS use the ID= attribute
> 
> name="box[1]" id="box1"
> 

Another JS approach I found recently:

Rather than refer to the checkbox as document.form_name.box[] (which
fails in javascript), use: document.form_name['box[]'].

-Roberto

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux