arunatata
asked on
Highlight HTML text when a radio button is clicked
Hi,
I have an ASP page with HTML text and a radio button next to it. Everytime the radio button is checked (on), I want the text to be highlighted. For example
ABC O
I want the text "ABC" to be highlighted if the radio button next to it is selected.
How can this be done?
Thanks,
A.
I have an ASP page with HTML text and a radio button next to it. Everytime the radio button is checked (on), I want the text to be highlighted. For example
ABC O
I want the text "ABC" to be highlighted if the radio button next to it is selected.
How can this be done?
Thanks,
A.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@arunatata :
Have you had a chance to try either of the recommended solutions? Both recommendations seem to suit your needs -- perhaps kiddanger's more fully than the simpler one I suggested.
Either way, please post back with an update as to whether you still need help, etc. If so, we'll be happy to continue to help. If not, please distribute points as you feel appropriate and close the question.
Thank you!
peh803 / Phil
Have you had a chance to try either of the recommended solutions? Both recommendations seem to suit your needs -- perhaps kiddanger's more fully than the simpler one I suggested.
Either way, please post back with an update as to whether you still need help, etc. If so, we'll be happy to continue to help. If not, please distribute points as you feel appropriate and close the question.
Thank you!
peh803 / Phil
...or send refreshments and dancing girls while we wait. (O:=
absolutely -- I wouldn't complain about that :)
ASKER
Sorry guys hadn't checked my questions for a while - Phil - I had already used your solution for my program before I saw any of the others so I am awarding you the points. Thanks for a quick response.
Aruna
Aruna
Glad I was able to help out!
Regards,
Phil / peh803
Regards,
Phil / peh803
<%@ Language=VBScript %>
<html>
<head>
<script type="text/javascript">
function hilite(v, t) {
var n;
var col = document.getElementsByName
for(var i=0; i<col.length; i++) {
n = t + (i + 1);
if(document.getElementById
document.getElementById(n)
} else {
document.getElementById(n)
}
}
}
</script>
</head>
<body>
<span id="text1">text</span><inp
<span id="text2">text</span><inp
<span id="text3">text</span><inp
<span id="text4">text</span><inp
<span id="text5">text</span><inp
<span id="text6">text</span><inp
</body>
</html>
Test page: http://kiddanger.com/lab/ee/q_21495537.asp