Im trying to dynamically check a checkbox using JQuery 1.5, based on something the user selects from a dropdown list. When the list changes it returns to this function:
function displaySystemResults(html){
var v = html.split(",");
document.getElementById('fUpdateSystemName').value = v[0];
if (v[1] == "true"){
alert("true");
$('#fUpdateActiveFlag').setAttribute('checked','checked');
}
}
Here is the dropdown list:
<td valign="top"><form:checkbox path="fUpdateActiveFlag"
name='fUpdateActiveFlag' value="checked" /> </td>
I can't get the checkbox to put a tick in the box. Can anyone spot what im doing wrong? I know its hitting the setAttribute method as the alert box is displaying when it should be set to true.