/    Sign up×
Community /Pin to ProfileBookmark

IE6: change name property dynamically on radiobutton

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_<&#37;= 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>[/CODE]

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;
[/CODE]

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?

to post a comment
JavaScript

1 Comments(s)

×

Success!

Help @WuWei spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...