...

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



denhamd2
01-20-2011, 03:22 PM
Hi,

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

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


$('input[name=myradio]').click(function(){
$('#my_anchor_tag_id').attr('href', $(this).val());
});



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum