radio selection turn text bold?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
slomotion
Forum Newbie
Posts: 13
Joined: Fri Jun 22, 2007 9:15 pm

radio selection turn text bold?

Post 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?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

This is a client side. You are probably going to want to look at Javascripts and event handlers.

Moved to Client Side.
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post 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";
				  }
				}
			}
Post Reply