On Mon, 25 Oct 2004 14:58:05 +0200, Kwart246 <kw*********@hotmail.com>
wrote:
Is it possible to use a text link to enable a radio button, just like
some windows interfaces, when the text is clicked, the radio button gets
selected.....
That's what LABELs are for.
<label for="controlId">Label text
<input id="controlId" type="radio" ...>
</label>
The for/id combination, or the control-as-content can be used separately,
but I've read that some older browsers only understand one, so its best to
combine both.
This works for a checkbox:
in head:
function changeBox(cbox) {
box = eval(cbox);
box.checked = !box.checked;
}
function changeRadio(rad) {
rad.checked = true;
}
Then as link:
<a href=""
Make that "#". IE doesn't recognise an empty URI as the current document
(though it does with the FORM action attribute). Stupid piece of junk.
onClick="changeBox('document.form1.textfield');ret urn false">click
this<a>
It would be far more sensible to pass a reference to the function, not a
string which you then coerce into a reference.
onclick="changeRadio(document.formName.elementName );return false;"
Though I prefer use of the forms and elements collections.
[snip]
Mike
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.