473,396 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Modifying an element name

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.
Jul 20 '05 #1
2 1044


El Diablo wrote:
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.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
Yes it is IE. bummer.

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:40********@olaf.komtel.net...


El Diablo wrote:
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.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Logical | last post by:
I have a form which houses basic inputs, as well as a few multiple select forms. I need to parse all the 'values' which are in this multiple select form (it gets manipulated dynamically client...
3
by: Jeff J. | last post by:
The basic concept is a music playlist that I'm trying to write as a table inside a div. I have Song and Playlist 'classes'. The Song class has a Write() method, as does the Playlist. The...
2
by: Kirk Is | last post by:
Hi there. I'm trying to improve a simple javascript based graphics editor for Atari 2600 games (long story) with better use of CSS and Javascript. I'm a little weak on what CSS can and can't...
6
by: Prashanth Ellina | last post by:
Hi, I am an XSLT newbie. I need to solve something which I will express in pseudo-code. function f1() { xmltree = <emptydom> addnamevaluepair(xmltree, "size","100")...
9
by: Stefan Mueller | last post by:
I'd like to set a variable called 'FocusIsOn' if a button got the focus. Because my button is dynamically created I do it like xelement = document.createElement("input") xelement.type = "button"...
3
by: suresh | last post by:
Hi all, I have a hash table and I want to modify the value of a key. Please let me know how can that be acheived. Thanks Suresh
4
by: Mike | last post by:
I have a web service being consume by a new client. The WebMethod they are calling is called Process. So in the WSDL I have has 2 elements, Process and ProcessResponse. <s:schema...
11
by: GaryB | last post by:
Hi Guys, I've been battling with this one for hours - I hope that you can help me! My code modifies the <aon a page, from a standard document link into a link with a tailored onclick event. ...
2
by: rob.nikander | last post by:
Hi, I'm working on a web page that uses the DOM API to move elements within the page in response to an onclick event. My problem is that in Firefox (but not in Safari and IE) I can see...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.