I'm trying to write an javascript function to disable certain fields on a visualforce page if a checkmark field ("locked") is checked. The javascript is failing and I've isolated the problem to my if statement. Can someone tell what I"m doing wrong here? (If I comment out the if statement the rest of the script works fine, and it is getting the value of PA.locked__c fine as well)
setTimeout(function(){
If("{!PA.Locked__c}" == true) {
//alert ({!PA.Locked__c});
//$('select').css({"border": "transparent","background": "transparent","box-shadow": "none"}).attr('disabled','disabled');
//$('textarea').css({"border": "transparent","background": "transparent","box-shadow": "none"}).attr('disabled','disabled');
//$('input[type="text"]').css({"border": "transparent","background": "transparent","box-shadow": "none"}).attr('disabled','disabled');
}
}, 1);