Page 1 of 1
radio selection turn text bold?
Posted: Thu Jul 12, 2007 12:54 pm
by slomotion
another newbie question but I am looking to have a radio selection and when selected will bold the items that are associated with the selection. does anyone have any idea on where to look for something like this. I have no clue how to even search for something like this or if it is even possible.
Help?
Posted: Thu Jul 12, 2007 1:03 pm
by RobertGonzalez
This is a client side. You are probably going to want to look at Javascripts and event handlers.
Moved to Client Side.
Posted: Fri Jul 13, 2007 4:12 am
by Gente
Have no time to make play with the font style, but main idea (color example) is following
Code: Select all
<form id="cucu" action="test.php" method="post">
<label id="text-1" style="color:#000;">
<input type="radio" name="mumu" onclick="toogle_style();" value="1" />
Test
</label>
<label id="text-2" style="color:#000;">
<input type="radio" name="mumu" onclick="toogle_style();" value="2" />
Test
</label>
</form>
Code: Select all
function toogle_style()
{
var label;
var i;
for (i = 1; i <= 2; i++)
{
label = document.getElementById('text-'+i);
if (document.forms.cucu.mumu[i-1].checked)
{
label.style.color = "#f00";
}
else
{
label.style.color = "#000";
}
}
}