Re: Using javascript with php

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

 



On Wed, Feb 15, 2006 at 05:10:53PM -0500, Sugrue, Sean wrote:
> To all,
> 
> I have a check box input which I assign an array to the name. I want to
> pass the array to a javascript and based on a certain criteria check
> the box. I use the syntax: formname.elements['array[]'][index].checked=
> true. It works with IE but since my buddy added an html validator
> to a config file we all use and now the code will not work in Firefox.
> Does anyone out there perform this task differently? Any suggestions?
 
I always assign ID's to my elements and reference them that way.

<input name="array[]" id="array_item_1" type="checkbox">

var element = document.getElementById('array_item_1');
element.checked = true;



-- 
cat .signature: No such file or directory

-- 
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