got the answer syntax error
i want to get value of asp.net check box via jquery , if its selected return true otherwise false. i'm doing this: -
var ApprovalRequired = $('<%= chkRequired.ClientID %>').is(':checked');
// also
var ApprovalRequired = $('<%= chkRequired.ClientID %>').val();
and the checkbox return in html as
<input id="ctl00_ContentPlaceHolder1_chkRequired" type="checkbox" name="ctl00$ContentPlaceHolder1$chkRequired" checked="checked">
in either way its returning 'false'. Any idea to get true when checked and false on unchecked
You forgot the #
in your selector:
$('#<%= chkRequired.ClientID %>').is(':checked');
That should work
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