| Matte Edens 2005-06-08, 3:58 pm |
| Use an "id" attribute on the select. Then getElementById() in your JS.
matte - matte@arubanetworks.com
webmonkey =BB arubanetworks.com
Ed Greenberg wrote:
>HTML_QuickForm seems to be taking my fieldnames and adding a pair of squ=
are=20
>brackets on the end. Thus
>
>$this-> addElement('select','counties','Counties
:',$allcounties,array('si=
ze'=3D>10,'multiple'));
>
>results in
>
><select size=3D"10" multiple=3D"multiple" name=3D"counties[]">
> <option value=3D"1">Hampden County, MA</option>
> <option value=3D"2">Hampshire County, MA</option>
>---snip---
> <option value=3D"15">Grafton County, NH</option>
> <option value=3D"16">Coos County, NH</option>
></select>
>
>The problem with this is that you can't direct Javascript at=20
>document.formname.counties[]
>
>or even at document.formname.counties\[\]
>
>I'm imagining that the [] is a form of communication from the rendering =
>part of quickform to the receiving part, probably indicating that multip=
le=20
>values are possible.
>
>Has anybody worked around the problem of applying javascript to these=20
>elements? We'd like a "clear" button to deselect everything in the selec=
t=20
>box.
>
>Justin? Any ideas?
>
>Thanks,
></edg>
>
> =20
>
|