Re: Input element duplicate names?

Discussion in 'HTML' started by Harlan Messinger, Feb 28, 2009.

  1. Ed Jay wrote:
    > Bad or OK...more than one input element with same name,
    > but in different forms?
    >
    > Example:
    >
    > <form name = "form1"....>
    > <input name = "joe"...>
    > </form>
    >
    > <form name = "form2"....>
    > <input name = "joe"...>
    > </form>
    >


    No problem at all, and to be expected if you have multiple forms on the
    same page that submit different sets of data to the same server resource.

    You can even have multiple input fields with the same name inside one
    form if the process on the server is prepared to deal with multiple
    pairs like joe=x&joe=y&joe=z in form data. ASP, for example, handles
    this situation by treating Request("joe") as an array.
    Harlan Messinger, Feb 28, 2009
    #1
    1. Advertising

  2. Harlan Messinger wrote:
    > Ed Jay wrote:
    >> Bad or OK...more than one input element with same name, but in
    >> different forms?
    >>
    >> Example:
    >>
    >> <form name = "form1"....>
    >> <input name = "joe"...>
    >> </form>
    >>
    >> <form name = "form2"....>
    >> <input name = "joe"...>
    >> </form>
    >>

    >
    > No problem at all, and to be expected if you have multiple forms on the
    > same page that submit different sets of data to the same server resource.
    >
    > You can even have multiple input fields with the same name inside one
    > form if the process on the server is prepared to deal with multiple
    > pairs like joe=x&joe=y&joe=z in form data. ASP, for example, handles
    > this situation by treating Request("joe") as an array.


    Oh--as to the question of whether it's *valid* in HTML: yes.
    Harlan Messinger, Feb 28, 2009
    #2
    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. Carl
    Replies:
    0
    Views:
    524
  2. Matt
    Replies:
    2
    Views:
    847
    Ben Edgington
    Oct 12, 2004
  3. Replies:
    2
    Views:
    502
  4. Jukka K. Korpela

    Re: Input element duplicate names?

    Jukka K. Korpela, Feb 28, 2009, in forum: HTML
    Replies:
    2
    Views:
    709
    Jukka K. Korpela
    Mar 1, 2009
  5. Sandman

    input names with '-' in their names.

    Sandman, Sep 3, 2003, in forum: Javascript
    Replies:
    4
    Views:
    104
    Lasse Reichstein Nielsen
    Sep 4, 2003
Loading...

Share This Page