Ok I have checked several solution and have no luck. What the heck am I doing wrong. I can retrieve the ID from check_controls doing an alert onload but not on change
<asp:CheckBox ID="chkAutoReverse" runat="server" CssClass="" Width="200px"
Text="Auto Reverse:" TextAlign="Right" AutoPostBack="false" />
$(document).ready(function() {
var check_controls = $('input[id*=chkAutoReverse]');
var AutoReverseOptions = document.getElementById('AutoReverseOptions');
$(check_controls).change(function() {
if ($(this).is(':checked')) {
alert($(check_controls).attr("id"));
} else {
alert($(AutoReverseOptions).attr("id"));
}
});
});
additional html markup
<div style="height: 60px">
<div class="singlepanelcontentleft">
<asp:CheckBox ID="chkAutoReverse" runat="server" CssClass="" Width="200px" Text="Auto Reverse:"
TextAlign="Right" AutoPostBack="false" /></div>
<div id="AutoReverseOptions" class="singlepanelcontentleft" style="display: none;">
<asp:RadioButtonList ID="optTabs" runat="server" RepeatDirection="Horizontal" RepeatLayout="Table"
Width="91%" Height="22px">
<asp:ListItem Text="Next Period" Value="1" Selected="true"></asp:ListItem>
<asp:ListItem Text="2 Periods from Now" Value="2"></asp:ListItem>
<asp:ListItem Text="3 Periods from Now" Value="3"></asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
this is nested in other divs and a fieldset. Pasting the other code did not render well