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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -