Patrick
1/14/2003 3:13:00 PM
Thanks, that was exactly what I was looking for. Just saw, that this Method
won't work on Netscape, because the onclick Event will be inserted into a
SPAN-Tag .. but no problem with that.
Thanks
"Kim Bach Petersen" <msnews@kensho.dk> schrieb im Newsbeitrag
news:eewC4lyuCHA.2372@TK2MSFTNGP12...
> > So, it should, when clicking one checkbox also select the other one.
> > The problem is, that when rendering the control the name Tag changes
> > to _ctl0:checkbox1 and so it can't be found anymore. When i add it
> > twice, it changes to _ctl1:checkbox1.
>
> Use the ClientId-property of the CheckBox to reference it clientside:
>
> "document.getElementById('" & checkbox1.ClientId & "').checked=true;"
>
> If you only need to adress one control, you don't need a specific
reference:
> you can send a reference to an object with a javascript function:
>
> <asp:checkbox runat=server id=checkbox2
onclick="javascript:goclick(this)"/>
>
> function goclick(mycheckbox) {mycheckbox.checked=true;}
>
> Kim :o)
>
>