Standardised field names

D

Dima Gofman

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
 
H

hywel.jenkins

Dima said:
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.
 
D

Dima Gofman

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.
 
H

hywel.jenkins

Dima said:
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.
 
D

Dima Gofman

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.
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.
 
R

Rob McAninch

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.
 
C

Chris Beall

Dima said:
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
 
T

Toby Inkster

Dima said:
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";
}

?>
 
H

hywel.jenkins

Dima said:
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.

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.
 
A

Adrienne Boswell

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top