Hi I am wondering why my checkbox won't check when I tell it to do so during a page load. Here's what I have:
if($('#contentPlaceholder_C003_ctl00_ctl00_C010_ctl00_ctl00_checkBoxes_0').is(":checked")==false){
alert('works');
$('input:checkbox[value="Sample 1"]').prop("checked", true);
}
It gets to the alert but after that it won't check the property.
EDIT Here's part of the HTML
<input id="contentPlaceholder_C003_ctl00_ctl00_C010_ctl00_ctl00_checkBoxes_0" type="checkbox" name="ctl00$contentPlaceholder$C003$ctl00$ctl00$C010$ctl00$ctl00$checkBoxes$0" value="Sample 1">
if I do like a click event using the same selector, it works.
EDIT2 It works in JSfiddle. I guess it has to do with Sitefinity. I'll have to take a look into it.
<input type="checkbox" id="test" checked="checked">
that will check it initially...undefined is not a function
when the page loads, so I think your selector inside the if is wrong. checking now.