I'm trying to check a check box from a button click event using Jquery but it's not working. What is missing from my code? Here is my html:
<input name="OldForm" id="OldForm" type="checkbox" value="1" <% if (ba.OLD_FORM.HasValue && ba.OLD_FORM.Value) Response.Write (" checked "); %> />
<input name="hdnOldForm" id="hdnOldForm" type="hidden" value="<% if (ba.OLD_FORM.HasValue && ba.OLD_FORM.Value) Response.Write ("1"); %>" />
Here is my javascript:
function testCheckbox() {
$("#ButtonAdd").click (function(){
$("#Oldform").prop("checked", true);
});
}
testCheckbox();
Go to the complete details ...