Standardised field names

Discussion in 'HTML' started by Dima Gofman, Dec 20, 2005.

  1. Dima Gofman

    Dima Gofman Guest

    Has any kind of standard been agreed upon (even preliminary) for naming
    conventions for field names?

    For example Google's search field is called "q", so is MSN's and I
    see a lot of sites that provide a search field use name "q" but Yahoo
    uses "p".

    Obviously having some kind of standard would be very convenient for the
    user who has auto-complete enabled which in the case of IE and FireFox
    seems to look at field name. So if I'm searching for something on
    some site, then go to another search site I wouldn't have to type in
    the whole search query again. Same with username and password, I tend
    to have the same set for most sites, so after loging in on one site
    auto complete will help with loging in on the next.

    What name should be used for username and password fields? "username"
    and "password"? Google, for example, on the sitemaps login page uses
    "Passwd". And Yahoo, for the email log in, uses "login" and "passwd".

    Dima
    Dima Gofman, Dec 20, 2005
    #1
    1. Advertising

  2. Dima Gofman

    Toby Inkster Guest

    Dima Gofman wrote:

    > Has any kind of standard been agreed upon (even preliminary) for naming
    > conventions for field names?


    No.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Dec 20, 2005
    #2
    1. Advertising

  3. Dima Gofman

    Guest

    Dima Gofman wrote:
    > Has any kind of standard been agreed upon (even preliminary) for naming
    > conventions for field names?


    I can't believe that there's any good use for such a thing. AutoFill
    is a PITA, and it's a security risk. How many times do you want to run
    the same search in different sites? What happens when you want to run
    a different search? It's crackers.

    --
    Hywel
    , Dec 21, 2005
    #3
  4. Dima Gofman

    Dima Gofman Guest

    Search is just one example, there are also usernames, passwords, email
    addresses, names etc. Every time you sign up for something you're
    asked your email address, I type it in the first time, next time I only
    type in the first letter. Security risk is completely irrelevant to
    this question. It's my choice to take that risk, if you personally
    don't want to take that risk - that's your own personal business.

    How can you seriously say that standardising field names is crackers,
    almost any kind of standardisation is an improvement (except of course
    artistic fields where uniqueness is valued)

    there's a lot of client side software that helps filling in forms etc.
    and whether you think it's a good idea to use them or not is
    irrelevant, point is people use these things and I for one would like
    to make it easier for those people to use my sites especially since at
    the same time it doesn't hurt those that prefer not to use these
    utilities.
    Dima Gofman, Dec 21, 2005
    #4
  5. Dima Gofman

    Guest

    Dima Gofman wrote:
    > Search is just one example, there are also usernames, passwords


    That's exactly why it's a bad idea.


    > How can you seriously say that standardising field names is crackers,
    > almost any kind of standardisation is an improvement


    Standardisation is, of course, an improvement, especially when the
    standard is updated. Then everything has to change. That's
    brilliant.

    --
    Hywel
    , Dec 21, 2005
    #5
  6. Dima Gofman

    Dima Gofman Guest

    wrote:

    > Standardisation is, of course, an improvement, especially when the
    > standard is updated. Then everything has to change. That's
    > brilliant.


    Perhaps we should also do away with XHTML and CSS 2/3? Is that what
    your misplaced sarcasm means?

    Look, you don't like using auto complete utilities, that's fine, I'm
    not a fan myself but surely you can agree that if commonly used fields
    were named the same it would be better for all of us, in the same way
    as it would be if IE and FireFox rendered html in the same way. Having
    standard names paves the way to simpler server-side data validation
    tools e.g. a field is called "email" so it should be *@*.* and so on,
    also if you inherit a project, it'll be easier to work out which field
    is what in server-side scripts.

    If you think auto complete agents are a bad idea then consider
    disability aids, imagine you cannot see properly, or cannot type easily
    and you're trying to fill in a form on an e-commerce site.

    P.S.
    > Dima Gofman wrote:
    > > Search is just one example, there are also usernames, passwords

    >
    > That's exactly why it's a bad idea.
    >


    If you're quoting someone, it's impolite to cut phrases so that they
    appear out of context, if you're going to quote, at least do it right.
    Dima Gofman, Dec 21, 2005
    #6
  7. Dima Gofman

    Rob McAninch Guest

    Dima Gofman>:
    > Having
    > standard names paves the way to simpler server-side data validation
    > tools e.g. a field is called "email" so it should be *@*.* and so on,


    That 'regex' looking thing won't validate an email BTW. Most form
    fields that could possibly be standardized are just going to be
    things like a Real Name (where you moreless have to accept whatever
    it is). Usernames, passwords, addresses, all those are going to have
    various restrictions depending on what you are doing with them on
    the server. E.g. database design or shippable addresses.

    It is rather trivial to see what field names are being submitted by
    a HTML form. Or examine the source of a server generated form. Then
    you validate for your needs and security.

    --
    Rob McAninch
    http://rock13.com
    Rob McAninch, Dec 21, 2005
    #7
  8. Dima Gofman

    Chris Beall Guest

    Dima Gofman wrote:
    > Has any kind of standard been agreed upon (even preliminary) for naming
    > conventions for field names?
    >
    > For example Google's search field is called "q", so is MSN's and I
    > see a lot of sites that provide a search field use name "q" but Yahoo
    > uses "p".
    >
    > Obviously having some kind of standard would be very convenient for the
    > user who has auto-complete enabled which in the case of IE and FireFox
    > seems to look at field name. So if I'm searching for something on
    > some site, then go to another search site I wouldn't have to type in
    > the whole search query again. Same with username and password, I tend
    > to have the same set for most sites, so after loging in on one site
    > auto complete will help with loging in on the next.
    >
    > What name should be used for username and password fields? "username"
    > and "password"? Google, for example, on the sitemaps login page uses
    > "Passwd". And Yahoo, for the email log in, uses "login" and "passwd".
    >
    > Dima
    >

    Dima,

    I agree that there's an opportunity to improve usability here,
    especially for the typing-challenged. But I think the better way is to
    do it in the OS, via keyboard macros.

    Getting thousands of web-site owners to agree on a convention is a
    loosing proposition. Look at how little consistency there is today with
    HTML and CSS, both of which are reasonably well defined and supported by
    an industry consortium.

    On the other hand, if an OS owner provided a keyboard-macro capability
    (that, say, let's you associate a 2-key combination with the string that
    is your e-mail address) then you could immediately use it everywhere, on
    or off the web. And since most folks only use one OS, the interface
    into such a macro facility wouldn't even need to be standardized across OSs.

    Some keyboard manufacturers include such a capability today.

    Chris Beall
    Chris Beall, Dec 21, 2005
    #8
  9. Dima Gofman

    Toby Inkster Guest

    Dima Gofman wrote:

    > a field is called "email" so it should be *@*.* and so on


    <?php

    function checkErr ($field, $regexp, $err)
    {
    if (!preg_match($regexp, $_REQUEST[$field]))
    return "$err\n";
    return '';
    }

    $errors = checkErr('email', '/.*\@.*\..*/', 'Invalid e-mail')
    . checkErr('age', '/^[0-9]+$/', 'Invalid age')
    . checkErr('name', '/[A-Za-z]+\s+[A-Za-z]+/', 'Please enter your full name');

    if ($errors == '') print "OK!";

    else
    {
    $E = explode("\n", $errors);
    print "<p>Errors occurred:</p>\n";
    print "<ul>\n";
    foreach ($E as $e)
    if ($e!='')
    print "<li>$e\n";
    print "</ul>\n";
    }

    ?>

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Dec 21, 2005
    #9
  10. Dima Gofman

    Guest

    Dima Gofman wrote:

    > Perhaps we should also do away with XHTML and CSS 2/3? Is that
    > what your misplaced sarcasm means?


    XHTML standards and field name standards are entirely incomparable.
    There's scope within the browser to render a variety of mark-up
    standards, and those standards are easy to impose on developers. You
    can't do the same thing with field names.


    > > Dima Gofman wrote:
    > > > Search is just one example, there are also usernames, passwords

    > >
    > > That's exactly why it's a bad idea.
    > >

    >
    > If you're quoting someone, it's impolite to cut phrases so that they
    > appear out of context, if you're going to quote, at least do it right.


    I would have quoted you in more context, but that wasn't really
    possible since you completely failed to quote *any* of my previous
    reply to you, dumbass.

    Go away and re-think your problem.

    --
    Hywel
    , Dec 22, 2005
    #10
  11. Gazing into my crystal ball I observed "Dima Gofman" <>
    writing in news::

    > Has any kind of standard been agreed upon (even preliminary) for naming
    > conventions for field names?
    >
    > For example Google's search field is called "q", so is MSN's and I
    > see a lot of sites that provide a search field use name "q" but Yahoo
    > uses "p".
    >
    > Obviously having some kind of standard would be very convenient for the
    > user who has auto-complete enabled which in the case of IE and FireFox
    > seems to look at field name. So if I'm searching for something on
    > some site, then go to another search site I wouldn't have to type in
    > the whole search query again. Same with username and password, I tend
    > to have the same set for most sites, so after loging in on one site
    > auto complete will help with loging in on the next.
    >
    > What name should be used for username and password fields? "username"
    > and "password"? Google, for example, on the sitemaps login page uses
    > "Passwd". And Yahoo, for the email log in, uses "login" and "passwd".
    >
    > Dima
    >


    I think you may be talking about apples and oranges. Yes, for a developer,
    knowing what the name of the search field in a HTTP_REFERER string is
    mandatory when you want to send the user to that query, and having to
    change the script for each SE is a PITA.

    But, for the user, the browser can do a lot for you. IE can use Google
    Toolbar which will fill out forms for you automatically (given that the
    developer has used common field naming conventions [1]). Firefox has a
    password manager, and Opera has a user information in its preferences which
    can be used to automatically fill in form fields, and it Wand feature for
    passwords.

    As to using the same query over several sites, there is always Copy and
    Paste.

    [1] Common field naming conventions, username, password, firstname,
    lastname, etc. As a developer, I use field names that identify the field,
    for instance I would use name="username", not name="txtfield3", because I
    might forget what name="txtfield3" meant when writing the script handling
    the form submission. Of course, I hand code everything, some programs like
    InterDev might do strange things.
    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne Boswell, Dec 23, 2005
    #11
  12. Dima Gofman

    Guest

    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. Paddy McCarthy
    Replies:
    3
    Views:
    707
    Anthony J Bybell
    Sep 24, 2004
  2. Bob
    Replies:
    1
    Views:
    381
    Lucas Tam
    Jul 30, 2004
  3. Chiller
    Replies:
    7
    Views:
    746
    Chiller
    Apr 12, 2004
  4. Sound
    Replies:
    2
    Views:
    436
    Randy Webb
    Sep 28, 2006
  5. jr
    Replies:
    3
    Views:
    414
Loading...

Share This Page