I hava a RadioButtonList control on my page that has multiple option.I want to handle change of its options and, according to value of selected option, do work.
This does not work:
$(document).ready(function () {
$('#RadioButtonList1').change(function () {
if ($(this).is(':checked')) {
alert("yes");
}
});
});
How I can Handle that?
thanks
You just need to bind the inputs themselves, not their group:
$(document).ready(function () {
$('#RadioButtonList1 input').change(function () {
// The one that fires the event is always the
// checked one; you don't need to test for this
alert($(this).val());
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With