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_ro les" value="<input type='checkbox'
name='replace_m e' value='1'><inpu t type='checkbox' name='replace_m e'
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.innerHTM L = document.myform .hidden_roles.v alue;
So far so good. I then run this javascript to replace the NAMES of
those checkboxes:
replace_roles = document.myform .hidden_roles;
replace_roles_l ength = hidden_roles.le ngth;
for (i=0; i<replace_roles _length; i++) {
//rename those checkboxes
replace_roles[i].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
rdlauer@gmail.c om
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_ro les" value="<input type='checkbox'
name='replace_m e' value='1'><inpu t type='checkbox' name='replace_m e'
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.innerHTM L = document.myform .hidden_roles.v alue;
So far so good. I then run this javascript to replace the NAMES of
those checkboxes:
replace_roles = document.myform .hidden_roles;
replace_roles_l ength = hidden_roles.le ngth;
for (i=0; i<replace_roles _length; i++) {
//rename those checkboxes
replace_roles[i].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
rdlauer@gmail.c om
Comment