I have this code and cannot get it to select the radio when I click on it’s image.
I’m I missing something?
Here is the current code:
<label style="display: inline; " for="test1">
<img src="images/image1.jpg" />
<input checked="checked" class="select_control" id="select1" name="test1" type="radio" value="value1" />
</label>
<label style="display: inline; " for="test2">
<img src="images/image2.jpg" />
<input checked="checked" class="select_control" id="select2" name="test2" type="radio" value="value2" />
</label>
The
forattribute in label should match input’sidand notname.nameis used for grouping radio buttons and checkboxes (when it’s the same name their are in a group, so checking one will will uncheck the other).Here’s a working example of your code: http://jsfiddle.net/nXb5a/