R
rdlauer
I've just run into a strange problem with IE 6 and I'm wondering if
anyone else has seen the same:
On my form I have a hidden field that contains the HTML for a series of
checkboxes:
<input type="hidden" name="hidden_roles" value="<input type='checkbox'
name='replace_me' value='1'><input type='checkbox' name='replace_me'
value='2'>"
Weird, I know, just stay with me...
I load the value of that hidden field into a new table cell created
with:
mycell.innerHTML = document.myform.hidden_roles.value;
So far so good. I then run this javascript to replace the NAMES of
those checkboxes:
replace_roles = document.myform.hidden_roles;
replace_roles_length = hidden_roles.length;
for (i=0; i<replace_roles_length; i++) {
//rename those checkboxes
replace_roles.name = "whatever" + counter;
//the counter will change each time this is run
}
This WORKS. It DOES rename the checkboxes. HOWEVER, if I run this whole
process again on the same page (I'm adding another series of checkboxes
somewhere else) it's as if IE doesn't remember that it already renamed
those first checkboxes, so it renames ALL of them again.
This all works fine in Firefox. Any ideas? I know this is a weird one.
Thanks in advance!
Rob
(e-mail address removed)
anyone else has seen the same:
On my form I have a hidden field that contains the HTML for a series of
checkboxes:
<input type="hidden" name="hidden_roles" value="<input type='checkbox'
name='replace_me' value='1'><input type='checkbox' name='replace_me'
value='2'>"
Weird, I know, just stay with me...
I load the value of that hidden field into a new table cell created
with:
mycell.innerHTML = document.myform.hidden_roles.value;
So far so good. I then run this javascript to replace the NAMES of
those checkboxes:
replace_roles = document.myform.hidden_roles;
replace_roles_length = hidden_roles.length;
for (i=0; i<replace_roles_length; i++) {
//rename those checkboxes
replace_roles.name = "whatever" + counter;
//the counter will change each time this is run
}
This WORKS. It DOES rename the checkboxes. HOWEVER, if I run this whole
process again on the same page (I'm adding another series of checkboxes
somewhere else) it's as if IE doesn't remember that it already renamed
those first checkboxes, so it renames ALL of them again.
This all works fine in Firefox. Any ideas? I know this is a weird one.
Thanks in advance!
Rob
(e-mail address removed)