I have been reading this excellent question and its answers, about collecting names from people in forms.
The best answer (the accepted one anyway) seems to be to follow the W3C's advice on personal names, which is to collect the entire full name in a single field, rather than using separate "first name" and "last name" fields.
They also describe an alternate field to ask the user "What should we call you?" - which I think is a good idea and is helpful for sending emails, displaying a welcome message, etc.
What I am struggling with is - now how do I take this information and let someone run a report using a "Last, First" name format? I would like to put a dropdown to select running the report with a default name format or this alternate format, but how do I obtain the alternate format to begin with?
According to the W3C document, I can't make any assumptions about the number of spaces in the full name, or which "name part" is considered the last name, etc. So the only thing I can come up with is to add yet another field to collect this version of the name from the user.
I don't really like that idea though, because it might be difficult to guide them to actually supply it in "Last, First" format. I can see that many users would just type the same thing in to all three fields.
Surely there has to be some interactive way to collect this data that is more reliable? Perhaps just a single "full name" field that when entered uses some javascript to produce values in dropdowns for the other two fields? That way the user could select the form they prefer. But I can't wrap my head around how I could populate those values reliably.
Maybe there is some other intuitive or interactive design that would help?
UPDATE
Ultimately, I built the Name Editor UI as follows:
The options in the "Full Name" dropdown are calculated automatically with each keypress in either of the textboxes. I allow spaces in either of the textboxes, so that accounts for users with multiple given or family names.
The only validation I perform is that at least one character is entered in one of the two fields. This means that the combined "full name" will be at least one character long.
I am basically combining the given and family name fields in either order, and with or without a space. Then I reduce that to combinations that are unique (in case they don't have anything in one of the two textboxes, or if their first and last names are the same) and trim any leading or trailing spaces. So they can have 1, 2 or 4 "full names" to pick from.
In most of the application, I use just the "full name" field. But when required for sorting or for special reports, I allow the given and family names to be used separately.
I think that covers all bases? Did I miss anything?
Answer
The recommendation of the W3C article is not to always collect full name via a single field, but to:
ask yourself whether you really need to have separate fields for given name and family name.
This, I think, is the key.
If you are going to need to use only part of a person's name, then collect that part. As the W3C article (and one that I wrote) make clear, names vary too much for anyone but an expert with a lot of time (Graham Rhind perhaps?) to develop an algorithm for parsing them.
Note also that rather than "first" and "last" name, you should use "given" and "family" name (again, as the W3C does). This is because in some cultures, family name comes first whereas in other cultures family name comes last. "Given" and "family" avoid any ambiguity and confusion.
In summary, the following will meet everyone's needs:
- Given name(s): [_________________________]
- Family name: [_________________________]
No comments:
Post a Comment