J
James Carters
Back again.
Despite changing the id in the form field and the corresponding 'for' in the
label IE still links the generated label to the form field it was cloned
from. Works in Firefox.
function selectfield(o){
var checked_owner_container =
document.getElementById('checked_owner_container');
var row = o.parentNode;
var new_checkbox = row.cloneNode(true);
checked_owner_container.appendChild(new_checkbox);
var checked_box = new_checkbox.firstChild;
var checked_box_label = checked_box.nextSibling;
var old_id = checked_box.id;
var new_id = 'js_' + old_id;
checked_box.setAttribute('id', new_id);
checked_box_label.setAttribute('for',new_id);
checked_box.checked = true;
checked_box.onclick=function(){deselectfield(this);}
}
Despite changing the id in the form field and the corresponding 'for' in the
label IE still links the generated label to the form field it was cloned
from. Works in Firefox.
function selectfield(o){
var checked_owner_container =
document.getElementById('checked_owner_container');
var row = o.parentNode;
var new_checkbox = row.cloneNode(true);
checked_owner_container.appendChild(new_checkbox);
var checked_box = new_checkbox.firstChild;
var checked_box_label = checked_box.nextSibling;
var old_id = checked_box.id;
var new_id = 'js_' + old_id;
checked_box.setAttribute('id', new_id);
checked_box_label.setAttribute('for',new_id);
checked_box.checked = true;
checked_box.onclick=function(){deselectfield(this);}
}