I’m trying to clone a node and change the name property of the radiobuttons of the node. It works for all browsers I’ve tried it in except Internet Explorer 6.
The HTML/ruby code looks like follows
[CODE]<tr id=”invites_invite_row”><td align=”center”><input type=”text” name=”login_<%= i %>” value=”<%= invite[1][:name] %>”></td>
<td align=”center”><input type=”radio” name=”role_<%= i %>” value=”2″ class=”radio”></td>
<td align=”center”><input type=”radio” name=”role_<%= i %>” value=”1″ class=”radio” checked=”checked”>
<td align=”center”><input type=”radio” name=”role_<%= i %>” value=”0″ class=”radio”></td>
<td><a class=”invites_remove_cell” href=”javascript:invites_remove(‘invite_rowid_<%= i %>’)”><%= image_tag(‘remove.gif’)%></a></td>
</tr>
I’m using prototype to select the radiobutton elements, and so far it works in Internet Explorer.
[CODE]invite_row = $(‘invites_invite_row’).cloneNode(true);
radiobuttons = invite_row.select(‘[class=”radio”]’);
radiobuttons[0].name = ‘roledb_’+i;
radiobuttons[1].name = ‘roledb_’+i;
radiobuttons[2].name = ‘roledb_’+i;
In firefox and chrome the name property is added to the element. But in Explorer 6 the radio button elements is empty of attributes except for the “class” attribute. I have no idea why this isn’t working? I’ve tried using the setAttribute method to no avail.
Anybody here that got a clue on what’s wrong?