Click to See Complete Forum and Search --> : Radio Group line go Bold when selected
dhassen
12-10-2003, 10:04 PM
I have a repeat region on a page that repeats a radio button and associated text. What I'm trying to do is have the associated line of text go Bold when that radio button is selected. The point is to have each radio group selection stand out so the user can easily see what has been chosen as they fill in the form.
I really appreaciate any direction I could get on this.
Thanks
D Hassen
Gollum
12-11-2003, 03:02 AM
Something like this should do...
<html>
<head>
<script type="text/javascript">
function setRadio(oRadio)
{
for ( var i = 0; i < document.f.card.length; i++ )
{
document.getElementById("c" + document.f.card[i].value).style.fontWeight = "";
}
document.getElementById("c" + oRadio.value).style.fontWeight = "bold";
}
</script>
<body>
<form name=f>
<input name=card type=radio value=0 onclick="setRadio(this);"><span id=c0>Ace</span><br>
<input name=card type=radio value=1 onclick="setRadio(this);"><span id=c1>King</span><br>
<input name=card type=radio value=2 onclick="setRadio(this);"><span id=c2>Queen</span><br>
<input name=card type=radio value=3 onclick="setRadio(this);"><span id=c3>Jack</span><br>
<input name=card type=radio value=4 onclick="setRadio(this);"><span id=c4>Ten</span><br>
</form>
</body>
</html>
dhassen
12-12-2003, 01:27 AM
Thank You, thank you, thank you. It works like a charm, and I no longer have to beat my head against the wall.
Thanks!