newCheck.type = "checkbox";
newCheck.onclick = updateCheckStatus;//Function to Call when clicked
newCheck.relatedUrl = currSearch.Query;//Expando String
newCheck.relatedObject = currSearch; //Expand Object
newCheck.checked = isChecked; //DOESN't WORK. isChecked is just a local Booelan Variable.
tagCell1.appendChild(newCheck);The closest related problem on the web that I found was this thread: Java Forums - Creating a checked Checkbox through javascript. The solution in this thread works.However I found another solution. Update the checked status after it has been added to the document. I have no idea why it works like this but it does work.var newCheck = document.createElement(<input name=relatedSearchesChk>');
newCheck.type = "checkbox";
newCheck.onclick = updateCheckStatus;//Function to Call when clicked
newCheck.relatedUrl = currSearch.Query;//Expando String
newCheck.relatedObject = currSearch; //Expand Object
tagCell1.appendChild(newCheck);
newCheck.checked = isChecked; //WORKSIf you know why this happens I would love to know: paul.kinlan@gmail.com
Technorati Tags |
Javascript [feed], Internet Explorer 6 [feed], Java Sun [feed], Checkbox [feed], Ie7 [feed], Internet Explorer [feed] |
Wikipedia Documents |
Internet Explorer ,Internet Explorer Box Model Bug ,Tabbed Document Interface ,Mozilla Firefox ,Wikipedia: Check Box ,Javascript ,Ecmascript ,Wikipedia: Ajax ,Json |