Hi there,
I have a table, each row of which contains 5 radiobuttons that the user
uses to specify a rating. From radio button to my object, no problem
there. However when I want to populate the radiobuttons with the
correct value, somehow they are not checked. Any idea why?
var ratingTd = document.createElement('TD');
for(var c = 1; c <= 5; c++) {
var ratingText = "<input type=\"radio\" name=\"eventRating" + index
+ "\" value=\"" + c +"\">";
var newCb = document.createElement(ratingText);
if(("" + c) == item.rating) {
newCb.checked = true;
}
var span = document.createElement('span');
span.appendChild(newCb);
span.appendChild(document.createTextNode(c));
ratingTd.appendChild(span);
}
row.appendChild(ratingTd);
I've stepped through the debugger to see that yes, the code
newCb.checked=true gets called according to the correct rating. But in
the rendered screen none of the buttons are ever checked. Why would
that be, I wonder?
Thanks
Ray