Modifying an element name

E

El Diablo

Hi there,

I'm trying to change the name of an HTML form element using JavaScript but
it doesnt seem to work. It just ignores the attempted change - no errors or
anything. I'm using the tag's id as a referrer:

document.getElementById('elementIdName').name = 'newName';

when I do an alert calling for the value of the form element using the
newName it returns an object not found error. If I use the oldName it works.
What gives? Is what i'm trying even possible?

Many thanks.
 
M

Martin Honnen

El said:
I'm trying to change the name of an HTML form element using JavaScript but
it doesnt seem to work. It just ignores the attempted change - no errors or
anything. I'm using the tag's id as a referrer:

document.getElementById('elementIdName').name = 'newName';

when I do an alert calling for the value of the form element using the
newName it returns an object not found error. If I use the oldName it works.
What gives? Is what i'm trying even possible?

Which browser is that? Probably IE. Yes, IE doesn't reflect changes to
the name attribute in the elements collection.
 
E

El Diablo

Yes it is IE. bummer.

Martin Honnen said:
Which browser is that? Probably IE. Yes, IE doesn't reflect changes to
the name attribute in the elements collection.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top