News for hackers. Stuff that matters.
Re:Why Users Fill Out Forms Faster with Unified Text Fields by oconnore on Friday July 29, 2011 @10:12AM (#2821831)
1. Why do you need to extract forename+surname? The assumption that your users will even have a forename and a surname is invalid.

[http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-b...]

2. There are exactly 50 states, so 50 names and 50 abbreviations. You are expecting the data in "City, State" format, so you parse the form in Javascript when the user finishes typing. If the data after the comma matches one of 100 strings, turn the form green, otherwise turn the box red.

3. Put the expected representation in the label. Parse the form as the user is typing, and replace the date with your interpretation when the box loses focus ("01/23/12" => "January 23, 2012") Turn the box red if the month is > 12 or the day > 31.

If the user has Javascript disabled, display a verification screen after the form is submitted.

Re:Why Users Fill Out Forms Faster with Unified Text Fields by jameshart on Friday July 29, 2011 @11:38AM (#2822359)
Strange to, on one level, make the valid and useful observation that forename + surname is a cultural assumption, then go right ahead and make the cultural assumption that the form should only accept US addresses (and even then ignoring DC, PR, Guam, and forces serving overseas...). Even with your scheme, you'd better hope nobody types in Beverly Hills, LA. And you'll need a spellchecker to help out people who can't spell Missississississippi.
Re:Why Users Fill Out Forms Faster with Unified Text Fields by robfig on Friday July 29, 2011 @12:12PM (#2822526)
It's not necessarily a "cultural assumption" -- many companies only do business in the US. However, people of any ethnicity may reside here. Seems consistent to me.

I agree that splitting the city state is probably more complicated than it's worth though.

Re:Why Users Fill Out Forms Faster with Unified Text Fields by zbanks on Friday July 29, 2011 @01:51PM (#2822972)
It seems like a reasonable assumption for a user to know the two-letter abbreviation of the state they live in.

If you suggest otherwise, how do we know that they can spell their street correctly?

Re:Why Users Fill Out Forms Faster with Unified Text Fields by jameshart on Friday July 29, 2011 @02:47PM (#2823207)
The question here though is not whether people can spell things correctly or correctly identify what state they live in, as whether you can write a computer program to, given what someone claims is their address, reliably break it down into parts to, for instance, extract what state they live in.

If you give someone separate fields for 'city' and 'state' you have some chance of figuring out where they are located if they type 'Washington' into one of those fields. If you ask them just for 'city, state', some people will understand that as 'city or state' and just type 'Washington', and you have no idea what they mean. The example I gave before, LA, is an example of a city which shares its name with a state abbreviation.

An anecdote for you: I was once working with UK callcentre system which had a form for callcentre staff to update customer contact addresses. UK postcodes are combinations of letters and numbers, and certain letters are excluded from certain positions to prevent ambiguous handwritten letterforms causing confusion. I naively implemented strict postcode validation, thinking it would help catch data entry errors. What actually happened was that we ended up, in a significant number of cases, telling people that the postcode that they had been using as part of their address for decades was not, in fact their postcode - it couldn't be because it was an invalid postcode. This made the customers quite cross, and we had to change it.

Do you want your validation message to be the one to break it to some eighty year old guy that Nebraska is actually NE, not NB any more?

Re:Why Users Fill Out Forms Faster with Unified Text Fields by pavel_lishin on Friday July 29, 2011 @02:34PM (#2823158)
But is it a reasonable assumption that they'll enter the abbreviation, instead of the state name?
Re:Why Users Fill Out Forms Faster with Unified Text Fields by ZeroMinx on Friday July 29, 2011 @11:09AM (#2822179)
"2. There are exactly 50 states, so 50 names and 50 abbreviations."

Considering the Internets is a really really big place (not just America), that statement is rather quite false.

Re:Why Users Fill Out Forms Faster with Unified Text Fields by smackfu on Friday July 29, 2011 @11:41AM (#2822375)
There are actually 8 more non-states (like MP, AS, PR), and 6 for overseas military. Just to cover the US.
Re:Why Users Fill Out Forms Faster with Unified Text Fields by DrJokepu on Friday July 29, 2011 @12:54PM (#2822703)
Often, you have to have a first name and last name due to various business / legal constraints. There is no way around it, even though, as you've correctly said, not everyone has a first name and a last name. Unfortunately lawmakers are often not culturally sensitive enough to understand that.
Re:Why Users Fill Out Forms Faster with Unified Text Fields by saurik on Friday July 29, 2011 @02:33PM (#2823151)
What is an example of such a legal constraint? (The only name-related legal compliance issues I can come with off the top of my head demand "full name".)
Re:Why Users Fill Out Forms Faster with Unified Text Fields by bena on Friday July 29, 2011 @11:02AM (#2822134)
"You are expecting the data in "City, State" format"

This is a bad assumption. What you should do is throw away commas, split along whitespace, and then see if the last element split is a valid state or territory.

Because some lazy guy will type "new orleans la" and just ruin your day.

Re:Why Users Fill Out Forms Faster with Unified Text Fields by masterzora on Friday July 29, 2011 @02:07PM (#2823029)
And then some non-lazy guy types in Albuquerque New Mexico and you find that Mexico is not a US State.

I know, this isn't a particularly difficult thing to work around, but I was amused that you replaced one bad assumption with another.

Re:Why Users Fill Out Forms Faster with Unified Text Fields by bena on Tuesday August 02, 2011 @12:46PM (#2837751)
Oh well, getting closer. ;)

We could always start taking from the back and doing look ups until we have a match or we finish the string.

Re:Why Users Fill Out Forms Faster with Unified Text Fields by pavel_lishin on Friday July 29, 2011 @02:35PM (#2823163)
Dallas, TX, 75254.

Is "." a state? How about "75254"?

Re:Why Users Fill Out Forms Faster with Unified Text Fields by Hyena on Saturday July 30, 2011 @03:45AM (#2825195)
Why even bother with the state? Just get the postal code.

Hell, just let the user write in the postal code and use their IP address to match it with the country of residence. They can put any number in there and you can match it to some location. No states. No assumptions. Well, beyond the one about IP address being accurate, I guess.

Re:Why Users Fill Out Forms Faster with Unified Text Fields by pavel_lishin on Friday July 29, 2011 @02:33PM (#2823149)
> 2. There are exactly 50 states, so 50 names and 50 abbreviations.

Quick, spell the state that starts with "M" and ends in "ets"! How about "M"-"pi"? "T"-"see"?

I know, it's almost trivial to guess at misspellings. But that's just another piece of code you have to write.

Re:Why Users Fill Out Forms Faster with Unified Text Fields by spc476 on Saturday July 30, 2011 @01:51AM (#2825015)
Not if you know what to look for. I came across code that implements the metaphone algorithm (http://en.wikipedia.org/wiki/Metaphone) and used it for a sample project I started, but never finished, years ago (http://boston.conman.org/cgi-bin/location/location.cgi). It could be modified to allow free form text, instead of the text field for the city, pull-down for the state, but that's an implementation detail.

But the point is---code to check for misspellings already exists.