...

[help] Radio Box select with image?

csj16
05-03-2007, 01:05 PM
I am not very familiar with JavaScript and I'm not sure if what I need uses JS. But let me ask anyway.

I have a form with "radio buttons" and next to each radio box I have an image. When you click on a specific image it will "select" the corresponding radio box.

I hope this problem is clear, Is there a way of doing this? I would be so grateful for any help or tips! :thumbsup: :thumbsup:

csj16
05-03-2007, 01:27 PM
I have managed to do what I need to do using an onclick on the image, but what I now need is to deselect the other radio buttons when one is selected. So lets say radio box 1 is selected, then radio box 2 and radio box 3 must be deselected. How do you do this?

Vladdy
05-03-2007, 01:40 PM
Learn about <label>s so you do not have to misuse scripting and give the same name to your <input> elements representing radio buttons...

glenngv
05-03-2007, 03:32 PM
This is what Vladdy is saying. Scripting not needed.
<input type="radio" name="rad" id="rad1" value="1" /><label for="rad1"><img src="rad1.jpg" alt="" /></label>
<input type="radio" name="rad" id="rad2" value="2" /><label for="rad2"><img src="rad2.jpg" alt="" /></label>
<input type="radio" name="rad" id="rad3" value="3" /><label for="rad3"><img src="rad3.jpg" alt="" /></label>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum