[Solved] Change div visibility when radio button becomes selected [closed]


You need ClientID in javascript not the server id as asp.net will generate the new CliendID for server controls and the selector you have wont find element by that id.

$("#<%= RdbToday.ClientID %>").change(function () {
    $("#dateSelectorSpan").hide();
}); 
$("#<%= RdbDateRange.ClientID %>").change(function () {
    $("#dateSelectorSpan").show();
});

Edit

The code you have is working.

Live Demo

$("#RdbToday").change(function () {
    $("#dateSelectorSpan").hide();
});
$("#RdbDateRange").change(function () {
    $("#dateSelectorSpan").show();
});

2

solved Change div visibility when radio button becomes selected [closed]