Hello,
In javascript, radio buttons are part of an array, so you would use
something like
document.formName.radioButtonName[0] to refer to your first button,
document.formName.radioButtonName[1] to refer to your second button, and so
on for each option you have.
So, to set a button to clicked if someone clicks on the text, you would do
something like
<span onClick="setButton(0);">text following button</span>
<span onClick="setButton(1);">text following next button</span>
and then write function
setButton(x){document.formName.radioButtonName[x].checked="true";}
I think this should work...I may not have gotten it exactly right, as I am
still new to javascript myself, but I thought that I would try to help.
Amy
-----Original Message-----
From: Cointot Jérôme [mailto:cpernelle@i...]
Sent: Monday, March 19, 2001 11:15 AM
To: javascript
Subject: [javascript] how to identify ONE radio button ?
hi,
in many programs when you have a radio button, if you click on the
following text this acts as if the radio button had been checked.
But in html, it is not possible...
so i'm trying something with
<span id="truc" onClick="?" >the text which follows the radio button</span>
but i can't identify exactly THE right radio button!!
someone has an idea?
thanks