Posted By

penguin999 on 07/24/07


Tagged

jquery radio selector


Versions (?)

Who likes this?

17 people have marked this snippet as a favorite

omixen
francisre
heinz1959
AgentPhoenix
yetanother
martingoldszein
jasonseney
CommissarXiii
mecha
maxvee8
fetolio
palimadra
italianst4
davidsi
bobbym245
seanpowell
zayyarphone


Radio button values using jquery


 / Published in: JavaScript
 

  1. // for older jquery
  2. var var_name = $("input[@name='radio_name']:checked").val();
  3.  
  4. // for jquery 1.3
  5. var var_name = $("input[name='radio_name']:checked").val();

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: omixen on April 16, 2008

Can you put single quote around 'radio_name' ? They should have this on jQuery site. :)

Posted By: omixen on April 16, 2008

Can you put single quote around 'radio_name' ? They should have this on jQuery site. :)

Posted By: jasonseney on October 15, 2008

Is it possible to edit your own snippet? Im not sure if penguin999 could even add the single quotes. I hope we can edit posts!

Posted By: omixen on October 21, 2008

I think only original author could edit them. I have to create a new one since I use this snippet on my blog.

Posted By: omixen on October 21, 2008

sorry to promote my own snippet, I just added the single quotes there:

http://snipplr.com/view/9166/get-radio-button-value-using-jquery/

You need to login to post a comment.