Get value of asp.net CheckBox via jquery(true/false) -
got answer syntax error
i want value of asp.net check box via jquery , if selected return true otherwise false. i'm doing this: -
var approvalrequired = $('<%= chkrequired.clientid %>').is(':checked'); // var approvalrequired = $('<%= chkrequired.clientid %>').val();
and checkbox return in html as
<input id="ctl00_contentplaceholder1_chkrequired" type="checkbox" name="ctl00$contentplaceholder1$chkrequired" checked="checked">
in either way returning 'false'. idea true when checked , false on unchecked
you forgot #
in selector:
$('#<%= chkrequired.clientid %>').is(':checked');
that should work
Comments
Post a Comment