Re: Valid form element names? How to use ID instead of name? Processing form data

Discussion in 'HTML' started by Jukka K. Korpela, Mar 6, 2004.

  1. "Grahammer" <postmaster@127.0.0.1> wrote:

    > Sorry for the newbie questions...


    You seem to need some help with getting started with Usenet. Please
    check http://www.cs.tut.fi/~jkorpela/usenet/dont.html

    > Is there a link somewhere that shows what defines a valid form
    > object (element) name or ID?


    We just had (or we are still having) a discussion of this in alt.html
    under the heading "Can tag name begin with a "-" character?". It's
    really about field names, despite the wording.

    > <input type="text" name="UserInput$" id="textbox1">
    > <input type="text" name="UserInput_" id="textbox1">
    > <input type="text" name="UserInput+" id="textbox1">


    All those name attributes are correct, as long as your form handler can
    deal with it. All Ascii characters are OK there.

    > ...also, could I use the ID like this since the input box has both
    > a name and ID?


    No, the id attributes are definitely incorrect, since the id attribute
    must be unique within a document. This belongs to the very essence of
    that attribute - it's raison d'etre, so to say. The id attribute makes
    no contribution to the form data, though. What you do in client-side
    preprocessing is a different issue, but surely you can find a way to
    work with unique id attributes, or take a different approach (like a
    class attribute, maybe).

    By the way, a validator (that is, an SGML validator, often misleadingly
    called "HTML validator") would have reported the problem with id
    attributes, since the HTML doctypes declare id attributes so that
    uniqueness is even a syntactic constraint.

    > I'm using a loop to process a form and I know how to read the
    > object name and value, but how about ID?


    Well, for _such_ questions, it is best to post a separate question
    (after resolving the HTML questions) to _a_ group discussing the
    scripting language you use.

    > P.s. Feel free to remove groups... I'm watching all that I've
    > posted to.


    If you have to crosspost, you're at least supposed to set followups (in
    almost all cases). Now set to alt.html, but please notice that it is
    more useful to continue an existing recent thread than to start a new
    one or to post to a new one that revolves around the same issue.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Mar 6, 2004
    #1
    1. Advertising

  2. Jukka K. Korpela

    Steve R. Guest

    Jukka K. Korpela wrote in message ...
    > You seem to need some help with getting started with Usenet. Please
    > check http://www.cs.tut.fi/~jkorpela/usenet/dont.html


    It's all very well you posting these "How to use Usenet" links Jukka, BUT
    it would be better if you actually told the OPs what they had done wrong
    first, then point them to the URL

    A whole thread has developed as a result of one of your previous pointers,
    as the OP had no idea what he had done wrong.
    Steve R., Mar 6, 2004
    #2
    1. Advertising

  3. Jukka K. Korpela, Mar 6, 2004
    #3
  4. On Sat, 06 Mar 2004 14:58:43 GMT, Grahammer <postmaster@127.0.0.1> wrote:

    [snip]

    > [...] but all the groups were relevant to my questions (as far as I
    > know) and I am watching all the groups as well.


    I think that it was off-topic in comp.lang.java.javascript. I believe the
    point of that group is to address queries that concern using Java and
    JavaScript together: to call a script from an applet, for example.

    Mike

    --
    Michael Winter
    lid (replace ".invalid" with ".uk" to reply)
    Michael Winter, Mar 6, 2004
    #4
    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.

Share This Page