I have a RadioButtonList
control that is declared like this:
<asp:RadioButtonList ID="rbtnlistUnits" runat="server"
RepeatDirection="Horizontal" RepeatLayout="Table">
<asp:ListItem Text="Metres" Value="M"></asp:ListItem>
<asp:ListItem Text="Feet" Value="Ft"></asp:ListItem>
</asp:RadioButtonList>
I want to be able to have the selection affect the features on-screen, but the change
event doesn't fire with selection of either button.
I originally didn't include the input
tag in the jQuery selection, and read online just now that this may have been the problem. It has been added but made not change.
I'm not hugely familiar with jQuery in ASP .Net, so I was wondering if the language's ListItem
control is an alias for something slightly different to input
.
$('#cSearch #rbtnlistUnits input').change(function() {
console.info("changed"); //doesn't appear in console
});
If this isn't the case, can anyone spot anything else that might be missing?
Thanks, Mark
try this
<asp:RadioButtonList ClientIDMode="Static" ID="rbtnlistUnits" runat="server"
RepeatDirection="Horizontal" RepeatLayout="Table">
<asp:ListItem Text="Metres" Value="M"></asp:ListItem>
<asp:ListItem Text="Feet" Value="Ft"></asp:ListItem>
</asp:RadioButtonList>
<script>
$(function() {
$('#rbtnlistUnits').change(function() {
console.info("changed");
});
});
</script>