tags:

views:

205

answers:

5

"A centenarian is a person who has attained the age of 100 years or more." - Wikipedia

There are several ways to prompt a user for Date of Birth, but let's say we've chosen the drop down method.

How would you handle the oldest selectable date? Do you pick an arbitrary year (such as 1875) and populate to present?

Or, do you consult some resource for a record breaking age (Jeanne Calment, age 122), add a couple of years, and populate backwards?

+14  A: 

Why not a text input box where they type in "1899" or whatever? When it is received you can validate that it is a legitimate number based on whatever criteria you use. I get annoyed by listboxes to select year of birth, because listboxes should not have that many values in them.


Rereading the question, you are assuming that listbox is the only option. In that case, 130 years ago seems like a good enough cutoff to me. If you're worried that the next world-record breaker will happen to be using your system, why not go with something like 200 years ago. Although I'd still say you should just use a text box.

Kip
That introduces extra parsing/error handling -- you probably should handle and cope with two digit years, along with the potential issues that introduces.
Rowland Shaw
If it's a web app you would need the parsing/error handling anyway as users might have modified the value selected by the form (e.g. via "hacking" the URI).
0xA3
This. I get annoyed scrolling down to 1984; I can't imagine what it must be like for my parents scrolling down to the '50s.
Adam Jaskiewicz
You do realize that you can type into a dropdown and you don't have to scroll?
Instantsoup
Depends on the browser. Many browsers will only let you jump through a dropdown by the first character, which is completely useless when it comes to years (they all start with 1).
Mike Koval
@Instantsoup typing just selects based on the first character (at least on IE and FF). Which means I have to hit "1" 19 times to get to 1981.
Kip
Yeah you're correct that it's pretty much my only option to use a drop down. With some persuasion I might be able to sell the use of a 4 digit numeric text box.
John Nelson
@Kip I'm pretty sure that FF 2.5 and 3.0 allows me to select input by typing the number / text. Of course if you don't type fast enough, it counts as restarting the text.
Zed
@Instantsoup and not all users are going to know this, and those user will be annoyed.
Ken Liu
You could use a 4 dropdowns! [1,2] [0,8,9] [0-9] [0-9] And then have fun validating.
Instantsoup
Never make users select a year with a dropdown. It's an atrocious way to pick from a large list of options, especially when it's so easy to validate from a textbox. Just put a note next to or below the textbox specifying the required format.
Matt Ball
@Instantsoup please tell me you're being sarcastic!
Matt Ball
Yes. And I voted for the textbox answer too.
Instantsoup
@Matt Ball Yeah you're right. Even better, I could still validate against a range on client side on blur.
John Nelson
@Instantsoup I know that. My parents don't, despite me showing them a few times. I'm pretty sure my parents are more typical internet users than I am, and they're more computer-savvy than many students I helped when I was working in the Mechanical Engineering computer labs at school. Also, it doesn't help in some browsers (or Flash-based forms, but that's another rant).
Adam Jaskiewicz
@Zed: @Instantsoup: you're right, i never knew they worked that way. i thought it only worked that way for *editable* drop-down boxes. you've just increased my productivity on birthdate forms by 1900%!
Kip
+1  A: 

It depends I think. Are you creating an application for young people?

If the application needs to be accessible for everyone, just create a configurable check and update it now and then. Look at http://en.wikipedia.org/wiki/Oldest%5Fpeople#Ten%5Foldest%5Fpeople%5Fcurrently%5Fliving for the oldest possible date.

A date picker is preferable, don't use irritating listboxes with 100+ values.

zwanz0r
I don't think list boxes with 100+ entries are a good idea, but I haven't seen a date picker that lets you pick a date a hundred years back in an easy manner. Do you have a good example somewhere (link)?
0xA3
Yeah, I agree with divo... date pickers have the potential to be more annoying than a drop down.
John Nelson
Yep, valid points. I was just thinking about date pickers for general date selection. For selecting your birthday, it can be horrifying. With the ASP.NET AJAX Calendar extension, you can go decades back quit easily (by clicking on the date). But still no 100 years ...
zwanz0r
+7  A: 

As you're going to have to perform server-side validate the input regardless of the control used, why not use a standard text input?

`<input type="text" maxlength="4"/>

This:

  1. Eliminates the centenarian problem.
  2. Easier to use, especially for older individuals (Assuming the list is in descending order).
  3. Smaller page size (don't need to include 100+ <option>....</option> tags.

If you must use a <select> box, I agree with your Wikipedia methodology. Ceiling the age of the oldest recorded person (126 -> 130 or 140) would be fairly risk-free.

Mike Koval
Mike, I like your insight. Smaller page size is a big deal, assuming there's a potential for this same year drop down to appear on the page more than once (oy!). This is a true possibility, and I will see if I can make that change. Thanks for also being open minded to consider my original question while making a suggestion for a better alternative.
John Nelson
+1  A: 

If you want to stick to drop downs, just pick an old enough date. Personally I think drop downs are bad both for the user and you. I find selecting my birthday from a list of hundred numbers annoying (even though firefox lets me select the date by typing it). But also I think a selection makes people tend to input fake years more than if they had to type it in.

If you can live with Javascript, a Combobox might be the best of both worlds. You can list 100 years in the list, and let older people type. This only has minor ethical problem, i.e. you purposefully make elderly people type =)

Zed
+1  A: 

My opinion on data entry like this is to cater to the user, not the programmer.
While, yes, a drop-down causes the least error handling, it's also tedious for the users.

Go for text entry that you need to validate. More code is needed in the back [allowing for both 2 digit years and 4 digit], but it's an easier experience for the user

Farrell
Using a drop-down menu requires *just as much* error handling as a text field. A malicious user could easily submit invalid values to any form control by constructing a faux query string or HTTP-POST request.
Mike Koval
oh yeah, forgot about that... So, if the error handling is going to be there, then the option should be whatever is easiest for the user to use
Farrell