View Full Version : Possible to use Jquery for radio buttons and submit?

01-20-2011, 04:22 PM

I have 3 radio buttons with the same name ("myradio"). The value of each is a different URL (eg. value="http://www.google.com")

I have a link underneath these (<a href="#">Send</a>). I would like the selected radio button's value to be inserted into the href of the link, and if the user selects a different radio button that this changes.

Is there any way of doing this using Jquery?

Thanks in advance

01-20-2011, 05:35 PM
It's easier to to if you give your anchor tag an ID:
<a id="my_anchor_tag_id" href="#">Send</a>

$('#my_anchor_tag_id').attr('href', $(this).val());