You are viewing limited content. For full access, please sign in.

Question

Question

How can I default to a radio button and color check mark?

asked on August 20, 2014

Hi

 

I have two questions:

 

1.  I have ,Y and N, Radio Buttons.  How can I default one to show selected (not blank)?

 

2.  I also have 5 check mark boxes that represent different color.  How can I color each individual check mark box to show its corresponding color?

 

Thanks

 

0 0

Answer

APPROVED ANSWER
replied on August 25, 2014 Show version history

If you want identical choices to be the same color, you could use a CSS rule like this:

 

input[value="Y"]+label {color:blue;}

Or, you could add a CSS class to your checkbox fields and use that as part of your selector. For example, you could add columnOne as a CSS class for the checkbox field in your first column, and then target it with a rule like this:

.columnOne input[value="Y"]+label {color:blue;}

 

1 0

Replies

replied on August 20, 2014

Please ignore question 1, i got this

0 0
replied on August 20, 2014 Show version history

With CSS, you can target a checkbox by its value. Replace #q1 with the appropriate field ID. Keep in mind that spaces in values will be replaced with underscores.

#q1 input[value="One"]+label {color:red;}
#q1 input[value="A_different_value"]+label {color:blue;}

 

 

 

1 0
replied on August 21, 2014

Hello Eric   Thanks for quick response....

 

I tried your suggestion but I still can't get any color changes.

 

Check mark group has q12 id and name of the check mark is Y or R

 

I modified your code and inserted the code into CSS box and saved the form  but changes are not reflected in the form?

 

  #q202 input[value="R"]+label {color:Red;}

 

0 0
replied on August 22, 2014

I believe you mean to use the following, your current code uses #q202 which is not correct since you said the group is #q12

 

#q12 input[value="R"]+label {color:red;}

 

0 0
replied on August 22, 2014

Sorry I made a spelling error.  12 should be 202. 

 

I tried it again but I am not getting any color.  Here is the actual values that I have pasted here.

 

#q202 input[value="B"]+label {color:red;}

 

Products:
id="q201" class="form-q"
id="q202" class="form-q"
id="q204" class="form-q"
id="q205" class="form-q"
id="q206" class="form-q"
id="q207" class="form-q"
id="q208" class="form-q"
 
 
id="" class=""
id="" class=""
id="" class=""
id="" class=""
id="" class=""
id="" class=""
id="" class=""

 

0 0
APPROVED ANSWER
replied on August 25, 2014 Show version history

If you want identical choices to be the same color, you could use a CSS rule like this:

 

input[value="Y"]+label {color:blue;}

Or, you could add a CSS class to your checkbox fields and use that as part of your selector. For example, you could add columnOne as a CSS class for the checkbox field in your first column, and then target it with a rule like this:

.columnOne input[value="Y"]+label {color:blue;}

 

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.