Modifying an element name

Discussion in 'Javascript' started by El Diablo, Feb 8, 2004.

  1. El Diablo

    El Diablo Guest

    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.
     
    El Diablo, Feb 8, 2004
    #1
    1. Advertising

  2. 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/
     
    Martin Honnen, Feb 8, 2004
    #2
    1. Advertising

  3. El Diablo

    El Diablo Guest

    Yes it is IE. bummer.

    "Martin Honnen" <> wrote in message
    news:40262bd3$...
    >
    >
    > 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/
    >
     
    El Diablo, Feb 8, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Heyes
    Replies:
    11
    Views:
    750
    Jason Heyes
    Feb 9, 2005
  2. Replies:
    9
    Views:
    295
  3. HANM
    Replies:
    2
    Views:
    735
    Joseph Kesselman
    Jan 29, 2008
  4. Wind

    Modifying service name and port name in WSDL

    Wind, Apr 1, 2008, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    532
    Tiago Halm
    Apr 1, 2008
  5. Replies:
    6
    Views:
    189
Loading...

Share This Page