strange label behavior in IE 6

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);}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top