RadioButtonList change event in jquery

Trap RedioButtonList change event in Jqury OR RadioButtonList selected value in Jquery:

<asp:RadioButtonList ID="rblBannerType" ClientIDMode="Static" runat="server" 
              RepeatDirection="Horizontal" >
    <asp:ListItem Value="image" Selected="True">Image</asp:ListItem>
    <asp:ListItem Text="html" >Html</asp:ListItem>

//jquery script
	$(function () {
		var t = $("#rblBannerType input:checked").val();

		//Banner Type
		$("#rblBannerType").change(function () {
			var type = $("#rblBannerType input:checked").val();
	function SetBannerType(type) {
		if (type == "image") {
		else {
Tagged with: ,
Posted in Asp.Net, C#
2 comments on “RadioButtonList change event in jquery
  1. Colin McBride says:

    Hi, this will work if you change

    //Banner Type
    $(“#rblBannerType”).change(function () {
    var type = $(“#rblBannerType input:checked”).val();


    //Banner Type
    $(“#rblBannerType input”).change(function () {
    var type = $(“#rblBannerType input:checked”).val();

    Notice the extra input in the identifier.
    Thanks for the code though, works for me and I wasn’t aware of the clientidmode=static property.

  2. pahamad says:

    Thanks Colin 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Top Rated

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

Blog Stats
  • 30,631 hits
%d bloggers like this: