jquery / javascript for a user to select 1 of n images

Posted by TesterTurnedDeveloper on Stack Overflow See other posts from Stack Overflow or by TesterTurnedDeveloper
Published on 2011-01-15T04:02:26Z Indexed on 2011/01/15 4:53 UTC
Read the original article Hit count: 227

Filed under:
|
|
|

I want to display a few images (probably 5 max) and have a user click to select one. First thing I tried was radio buttons and putting the images inside labels.

<input type="radio" name="BackgroundId" id="BackgroundId" value="1" />
<label for="BackgroundId"><img src="../../Content/images/thumb_1.jpg" /></label>

Firefox will select the radio button when the user clicks the image, but IE doesn't.

Is there a jquery plugin that will make the images clickable? Fancy-form looks like something I could use, but it isn't jquery and I've already got jquery in my project.

Or can someone point me to a better way of selecting a single image?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery