how to check radiobuttonlist using jquery?

Posted by Hariinakoti under jQuery on 10/31/2012 | Points: 10 | Views : 10913 | Status : [Member] | Replies : 3
Hi All,
How to check radiobuttonlist using jquery ?

Thanks & Regards
Hari



Responses

Posted by: Vasanthmvp on: 10/31/2012 [Member] Starter | Points: 25

Up
0
Down
Hiee here is an example:

<script language="javascript">


$(document).ready(function() {

$("#btnSubmit").click(function() {

alert($("#<%RadioButtonList1%>").find("input[name='<%=RadioButtonList1.UniqueID%>']:radio:checked").val());

});

});

</script>



<asp:RadioButtonList ID="RadioButtonList1" runat="server">

<asp:ListItem>1</asp:ListItem>

<asp:ListItem>2</asp:ListItem>

<asp:ListItem>3</asp:ListItem>

</asp:RadioButtonList>

<input id="btnSubmit" type="button" value="Submit" />

Refer http://forums.asp.net/p/1425301/3178137.aspx#3178137 to view another example.
Regards,

Awesome Coding !! :)

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sureshknkt7 on: 11/2/2012 [Member] Starter | Points: 25

Up
0
Down
HI,

Aspx Code:

<div>

<asp:RadioButtonList ID="radiobtn" runat="server">
<asp:ListItem Text="Hyderabad" Value="Hyderabad"></asp:ListItem>
<asp:ListItem Text="Khammam" Value="Khammam"></asp:ListItem>
</asp:RadioButtonList>
</div>



Jquery code:

<script type="text/javascript">


$(document).ready(function () {
$("#<%=radiobtn.ClientID%>").change(function () {
var rbvalue = $("input[name='<%=radiobtn.UniqueID%>']:radio:checked").val();

alert(rbvalue);
});
});
</script>


Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nkkppp on: 11/4/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

$(document).ready(function () {
$(':radio').bind("change", function () {
$('#HyperLink1').attr("href", $(this).val());
});

});

<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem Text="CNN" Value="http://www.cnn.com"></asp:ListItem>
<asp:ListItem Text="BBC" Value="http://www.bbc.co.uk"></asp:ListItem>
<asp:ListItem Text="Channel News Asia" Value="http://www.channelnewsasia.com"></asp:ListItem>
</asp:RadioButtonList>
<br />
<asp:HyperLink ID="HyperLink1" runat="server">Click here!</asp:HyperLink>

Regards,
Prathap.

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response