113

What is the best method for date of birth selector?

  • 3 text inputs (month / day / year) or one mask input. User MUST use keyboard
  • 3 select boxes. User can use keyboard or mouse.
  • One nice datepicker.

I want to know what is the most usable and problem free solution, so user wont be confused at all.

Ionuț Staicu
  • 21,360
  • 11
  • 51
  • 58

24 Answers24

163

If your goal is to make sure "the user won't be confused at all," I think this is the best option.

three dropdowns for month, day, year

I wouldn't recommend a datepicker for date of birth. First you have to browse to the year (click, click, click…), then to the month (click some more), and then find and click the tiny number on a grid.

Datepickers are useful when you don't know the exact date off the top of your head, e.g. you're planning a trip for the second week of February.

Community
  • 1
  • 1
Patrick McElhaney
  • 57,901
  • 40
  • 134
  • 167
  • 6
    Upvoted: This is exactly the answer I was going to give. Datepicker is good for 'I know it's a Friday' kind of situations, but for date of birth it adds no value. – slim Dec 04 '08 at 14:34
  • 15
    Downvoted: drop-downs are VERY annoying for users, especially for this kind of data. See Nielsen: http://www.useit.com/alertbox/20001112.html – Mauricio Scheffer Dec 07 '08 at 04:13
  • Plus, with jQuery datepicker it's very easy to have a text input + optional datepicker (http://docs.jquery.com/UI/Datepicker) – Mauricio Scheffer Dec 07 '08 at 04:17
  • 5
    @mausch That's why I prefaced my answer with "If your goal is to make sure 'the user won't be confused at all'" FTA: "Drop-down menus do have their advantages... because they are a standard widget (even if an unpleasant one), users know how to deal with a drop-down menu when they encounter it." – Patrick McElhaney Dec 08 '08 at 13:37
  • 1
    @patrick, you're right, dropdowns are very standard, but a simple textbox is more natural IMHO as it is closer to what a paper form would look like. My point is that people have "10/9/1975" deeply hardwired into their brains from all the repetitions, so let them write just that. – Mauricio Scheffer Dec 12 '08 at 13:49
  • IMO the best date input UI is google calendar's – Mauricio Scheffer Dec 12 '08 at 14:23
  • 25
    So, were you born on October 9 or September 10? I don't how to resolve that ambiguity with a simple text box. – Patrick McElhaney Dec 15 '08 at 14:00
  • 1
    That is solved by the user's locale. Each culture (locale or country) has its own date formatting convention. – Mauricio Scheffer Dec 31 '08 at 20:24
  • @Patrick McElhaney: simple solution is to display recognized value to user as soon as possible. I do that when parsing FogBugz due time: http://www.foglyn.com/screenshots/thumb-editing-due-time.gif, it's nice help. – Peter Štibraný Aug 10 '09 at 18:00
  • @PatrickMcElhaney Perhaps the best way is to always spell out the month. E.g.: "Jan.", rather than 01. There's definitely no ambiguity left with that, assuming you are using a 4 digit year. – Joel B Sep 17 '13 at 23:54
  • I think that @Patrick's solution that Google uses removes the confusion just as well as this one, and has the benefit of only requiring a single dropdown. – Elezar Jun 10 '15 at 20:32
146

Whilst this is a very old question, it is so important in getting a date of birth input correct, especially in a registration form.

I think no one has done this better than the google accounts sign up:

Google Account signup

Select the month first from a select box and manually type in the date and year. Simple.

Easy to validate. Easy for users to get right. No scrolling back the years in a select box from 1900-the present year. No need to update a 'day' select box based on month input. Works great on web. Works great on mobile. Works for all locales eg 01/10/2014 - is that the 1st October or 10th Jan? I expect we'll be seeing this birthday picker format a lot more in future.

A datepicker is just a poor solution all round. So many clicks! In my opinion, a datepicker is only useful when knowing the day of the week is important eg booking tickets.

Update 2/6/2016: I am from UK, so I am more familiar with day/month/year formats, rather than month/day/year. However, users who will use their cursor to select the month, I believe it is much easier having the select box first, rather than going input > select box > input. The comment date is 2nd June, not 6th Feb ;)

Patrick
  • 6,495
  • 6
  • 51
  • 78
  • Of course, Google get it right. Google _always_ get it right! – Dave Salomon Nov 03 '14 at 02:18
  • 10
    Why isn't this the top answer! – Snowman Feb 05 '15 at 09:09
  • 3
    One thing that I would say to add to this is to allow the user to type in the numeric value of the month to select a value, when that dropdown is selected. That is what most users are used to typing for a month, so would still "just work" for keyboard users. – Elezar Jun 10 '15 at 20:50
  • 2
    Actually, the more I think about, I don't really see a benefit to making the month be a dropdown at all. Why not just make it a text field as well? – Elezar Jun 10 '15 at 21:01
  • 4
    To avoid confusing month and day, mostly. – Maciej Gurban Oct 30 '15 at 09:25
  • 2
    Though those of us outside America usually have the Day before the Month. – jezmck May 13 '16 at 08:23
  • 1
    @jezmck Including me, but I prefer the aesthetics of the select box being to one side, not in between two inputs. – Patrick May 13 '16 at 10:53
  • @Snowman, a select box for a month is three clicks on mobile: click on dropdown, scroll down to month, click something to click out of this drum-roll type silly thing on phones, and then click on to something else. Compare this to a single text box or a tabbed set of text boxes as mentioned below, which is quick on every device. – PKHunter Jun 01 '17 at 04:16
  • Year, Month, Day is the order that makes the most sense, especially when paired with time. – Gringo Suave Feb 22 '18 at 06:43
  • 2
    Year, Month, Day makes sense to programmers. That makes it a great input if your customers are all programmers. However, for those of us serving a non-technical international audience, this answer solves many problems at once, since it is the least likely to be misused. The only issue left is people who do not know their date of birth. – inopinatus Jul 25 '18 at 06:15
28

For an advanced user text input is the best, if the user knows the date format, it is very fast. For a not so advanced user I suggest using a datepicker. Since usually you also have advanced and non-advanced users I suggest a combination of text input and datepicker.

asalamon74
  • 6,120
  • 9
  • 46
  • 60
  • 119
    The problem with most datepickers is that it's painfull to go back 30/40/or more years. – UnkwnTech Dec 04 '08 at 10:36
  • 3
    Although now that I look at the one he offered I guess its not to bad. – UnkwnTech Dec 04 '08 at 10:37
  • 22
    Date picker is actually a terrible user experience when entering DOB, because of the need to go back several years as mentioned by Unkwntech. Plus, a date time picker puts value of the location of a particular date relative to the structure of the month and week, which is not needed when picking a DOB. – Alex Czarto Apr 08 '10 at 16:12
  • 7
    jQuery's datepicker has an [option for showing option dropdown menus for month and year](http://jqueryui.com/demos/datepicker/#dropdown-month-year), making selecting a birthdate much faster. – Carl G Jun 18 '12 at 16:24
  • 1
    Here is an example of a masked text input with HTML5 regex to force numeric keyboard on iOS devices: https://cde.boaterexam.com/washington/register – Alex Czarto Oct 14 '14 at 18:42
  • @AlexCzarto actually all that pattern would do is require all characters in the box to be numeric, except "novalidate" is specified on the form so it won't do anything at all. Setting the type to "tel" is what shows the numeric keyboard on mobile devices. On top of that, they're using a jQuery formatDate plugin which formats the date on keyup, and rejects non-numeric characters. – Niall Feb 16 '16 at 16:32
  • @Niall also shows numeric keywboard: http://stackoverflow.com/questions/6178556/iphone-numeric-keyboard-for-text-input – Alex Czarto Feb 17 '16 at 18:09
26

As mentioned in this Jakob Nielsen article, drop down lists should be avoided for data that is well known to the user:

Menus of data well known to users, such as the month and year of their birth. Such information is often hardwired into users' fingers, and having to select such options from a menu breaks the standard paradigm for entering information and can even create more work for users.

The ideal solution is likely something like follows:

  • Provide 3 separate text boxes for day, month, and year (labeled appropriately)
  • Sort the text boxes according to the user's culture.
  • Day and Month text boxes should be sized so that a 2 digit input is assumed.
  • Year text box should be sized so that a 4 digit year is assumed.
  • Allow the user to enter a 2 or 4 digit year. Assume a 2 digit year is 1900, and update the textbox to reflect this onBlur (or on a following confirmation step).
  • Allow the user to enter either a month number OR month name.

EDIT: Here is how we implemented our DOB picker: Masked text input field with HTML5 regex to force the numeric keyboard on iOS devices.

http://www.huntercourse.com/usa/texas/

Alex Czarto
  • 3,151
  • 4
  • 28
  • 28
  • The only thing I would modify on your DOB picker is to put the "MM" "DD" "YYYY" as placeholder text rather than a hint. – Paul Pettengill Nov 06 '14 at 21:56
  • @Paul Using placeholder text has its usability challenges. Although we initially *did* have it, we decide to remove it after reading this: http://www.nngroup.com/articles/form-design-placeholders/ – Alex Czarto Nov 08 '14 at 00:28
  • @AlexCzarto nice picker! (but just so you know, if you enter something like 02/31/1970 it'll give you the wrong error message) – Thiago Duarte Jan 27 '15 at 21:11
  • If was born on 5th June 2001 I'd type my DOB as "050601", which your suggestion would interpret as 6th May 1901. If you have text boxes, you're relying on the user to spot the MMDD date order and enter their info appropriately, if you provide a dropdown for month then the user will be forced to notice the out of order placement of the month. – thelem Oct 04 '16 at 11:58
  • If you size the month text box to be 2 digit, how do you allow the user to enter either a month number OR month name? – Jin Wang Apr 10 '17 at 15:31
  • LOL I broke your DOB picker in like 5 seconds. If you delete a single space from it, it gets broken and says "Please enter your date of birth". I think one needs to be very careful when adding slashes and spaces for the user. – Jan Kalfus May 03 '18 at 14:56
11

Birthdates are different from other dates because people are often used to typing their specific birthdate.
A text box with an example is clear, quick and easy to enter:

 _______
|_______| (example: 31/3/1970)

This should support flexible formatting such as 1/1/1970 or 20/07/70.

If you have to support different cultures with different date conventions (e.g. US and UK) then this could be error-prone for people who don't heed the example. To avoid this you could use a
select list for month, and text boxes for date and year.

 _________   __   ____
|March  |V| |__| |____|

This removes ambiguity between day and month ordering, but is a little clunkier to use.

Bennett McElwee
  • 24,740
  • 6
  • 54
  • 63
5

You should take a look at Datejs.

Datejs is an open-source JavaScript Date Library.

Comprehensive, yet simple, stealthy and fast. Datejs has passed all trials and is ready to strike. Datejs doesn’t just parse strings, it slices them cleanly in two.

Giovanni Cappellotto
  • 4,597
  • 1
  • 30
  • 33
  • 6
    The plugin looks great, but 25KB for a simple problem seems a bit much... – Zephyr was a Friend of Mine Jan 25 '12 at 10:36
  • Disagree with Noel. Dates are the most complicated thing that programmers typically run into, especially across timezones and cultures (which is what Datejs is designed for). – Rustavore Jun 06 '13 at 02:21
  • 1
    @Gitninja -- that's a bit of a strawman. She didn't say it's too much for a date (which is extremely complex) but for a "simple problem", I assume the "date of birth" problem. Since there are huge amount of javascript libraries and methods that a solution can be achieved without 25KB, I would agree. – Kerry Jones Jan 28 '14 at 17:42
  • If adding 25kb to my form means that I don't have to use dropdown menus then so be it – ladieu Jun 04 '14 at 15:01
4

I'm troubled by the preponderance of solutioning instead of designing. The OP said, "I want to know what is the most usable and problem free solution, so user wont be confused at all." So whether it's jQuery or JavaScript or C# or FORTRAN, the design is important--and it's the UX design, not the UI design that matters here. (Another plea to avoid the incorrect and illogical construct "UX/UI").

Use text input. Use three separate boxes labeled Day, Month, and Year (or Month, Day, and Year). Let users type the dates. Mixing text and lists in the same interaction is a Bad Thing (don't use text input for year but date picker or lists for month and day, for example).

Use a single text field that uses in-field format hints, for example, [ day / month / year ] Don't require formats too rigidly. If a user type JUN in the place where you expect a month, then use June on the back end. If a user types 6 in the place where you expect a month, then use June on the back end. If a user types 06 in the place where you expect a month, then use June on the back end.

Use Occam's Razor as a guide (in effect, most of the time the data will be accurate enough). Reduce cognitive friction (don't make users think).

Joe
  • 41
  • 1
  • Using three separate text boxes means on a mobile I have to click into each for the numeric keypad to show up. Rest of your idea is good -- this should all be text boxes. – PKHunter Jun 01 '17 at 04:09
3

I would also recommend the combination of DatePicker and fields

See this demo, where the date picker does reflect the date entered in the fields by the user.
It is based however on a DatePicker using Prototype and Scriptaculous though. I mention it for illustration purpose.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
3

I had tried datePicker with my user but it turn out to be a bad UI to them. What I end up base on their request is to have 3 textbox where they can quickly type [ day ] [ month ] [ year ] :(

c.sokun
  • 1,622
  • 4
  • 25
  • 40
2

Put both and make each update the other. If the user chooses the date from the datepicker, it is easy to fix a minor misclick in the text field or visualize the choise you typed into text field in the datepicker.

Tuminoid
  • 9,445
  • 7
  • 36
  • 51
  • i can't put both, won't fit into design :) I need only one of those. – Ionuț Staicu Dec 04 '08 at 09:25
  • Since the datepicker needs javascript, use javascript to show it only when needed. Set the position to absolute so it will float over all other elements. – some Dec 04 '08 at 10:03
  • Normally you just put the text field and attach the icon next to it which pops up the datepicker. – Tuminoid Dec 04 '08 at 16:53
2

Why don't you test all three and pick the one that the performs the best? This seems like a good candidate for Google Website Optimizer to test.

It may be that the type of users you have, or the type of site you are running may dictate that your solution should be different than the "norm".

Nicolai
  • 3,698
  • 3
  • 30
  • 34
1

Whether to use a datepicker or not I think depends on how long ago the dates are. If they are typically in the current month, and almost never more than a few months old, and you know that Javascript will be around, a datepicker is good. If the dates are not recent (say, a birthdate) I think this is the best option:

http://img411.imageshack.us/img411/6328/mockupg.png

Note that this is different from Patrick McElhaney's answer in that the year is a text box, not a dropdown. Selecting a number from a drop down box that is hundreds of elements long is very annoying for the user.

Kip
  • 107,154
  • 87
  • 232
  • 265
1

I normally use both -- a datepicker that populates a textfield in the correct format. Advanced users can edit the textfield directly, mouse-happy users can pick using the datepicker.

If you're worried about space, I usually have just the textfield with a little calendar icon next to it. If you click on the calendar icon it brings up the datepicker as a popup.

Also I find it good practice to pre-populate the textfield with text that indicates the correct format (i.e.: "DD/MM/YYYY"). When the user focuses the textfield that text disappears so they can enter their own.

Stewart Johnson
  • 14,281
  • 7
  • 61
  • 70
1

As perhaps one of the older people here, and born late in the month, I find drop-down menus for birthdates to be frustrating. I typically have to scroll down on two drop-down menus, and that's awkward. I'd much rather type it in.

If you can have a control designed so that it can either accept drop-down menus or be typed into, and make it clear both work, that would be excellent.

David Thornley
  • 56,304
  • 9
  • 91
  • 158
  • This isn't really an issue because most browsers, when the dropdown widget is focussed, support typing to get quickly to the correct value – thepeer Jun 20 '10 at 06:26
  • @thepeer: But they don't look like it. There's not what John Norman ("Design of Everyday Things") called an affordance for typing. – David Thornley Jun 21 '10 at 15:07
1

I think a date picker just make the move more complicated to enter one's birth date.

As already mentioned, a combination of drop lists for days and months with a text box for the year seems the most efficient for a user. It takes just less than 10 seconds to enter a birth date this way, which is far quicker than a date picker: thanks to the tab key (which all users should learn to use to complete a form), it's fast to go from one form element to the next one.

At least under Macintosh (I don't know about Windows), you also can use the keyboard to access date inside select boxes: thanks to the tab key, you get the focus onto the form element, then press the arrow key to drop down the list, then type for instance 1967 and you get there in the blink of an eye…

Peter O.
  • 32,158
  • 14
  • 82
  • 96
Firebush
  • 11
  • 1
0

I have just discovered a plugin on JSFiddle. Two possible alternatives : 1 single input OR 3 inputs, but looks like a single one... (use Tab key to go to the next input)

[link]http://jsfiddle.net/davidelrizzo/c8ASE/ It seems interesting !

0

I think you can try plugin birthdaypicker,

enter image description here

legendJSLC
  • 437
  • 5
  • 7
0

you can use plugin cxcalendar. It looks like other datepicker. but you can pick year and month in select after clicking year-month title.

enter image description here

legendJSLC
  • 437
  • 5
  • 7
0

I would take a DatePicker. It's the only component that allows expert users to enter it manually and guides novices to enter a date very easy.

The calendar should not pop up if you enter via pressing tab, but clicking on a button. So no expert user is annoyed of it.

Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176
guerda
  • 23,388
  • 27
  • 97
  • 146
0

I would prefer a datepicker (and a input box with documented format as a fall-back) for an international site.

Date formats vary and are sometimes hard to read if you are now used to them. Too bad many people aren't comfortable with ISO 8601. :-(

stesch
  • 7,202
  • 6
  • 47
  • 62
0

I would suggest using a drop down menu for each field, making sure to label each as day, month and year. A date picker might also help, but if the user doesn't have JavaScript enabled, it won't work.

Philip Morton
  • 129,733
  • 38
  • 88
  • 97
0

JQueryUI datetime picker is best option as it allows pro users to enter their own value in textbox or they can choose it from picker.

Setting up picker to allow easy entering of birthdays or future dates is pretty easy too:

$(‘#datepicker’).datepicker({
    changeMonth: true,
    changeYear: true,
    yearRange: ‘-100:+50'
});

this shows something like this (cant post a photo as I'm new user: http://klalex.com/wp-content/uploads/2009/07/picture-1.png)

and yearRange shows dates from DateTime.Now.Year - 100 to DateTime.Now.Year + 50

found this on: http://klalex.com/2009/07/jquery-ui-datepicker-for-birth-date-input/

pajics
  • 2,938
  • 3
  • 23
  • 27
0

Who don't you use the jQuery UI DatePicker?

It's configurable to suit pretty much any needs. The only downside is if you're including it with jQuery UI it has a somewhat large footprint..

Update

Some of the file sizes appear to have changed, so they are updated below. Keep in mind these numbers will only be correct for the time they were last updated. Things may have changed since then.

  • CSS theme - 23kb
  • jQuery UI - 71kb minified
  • DatePicker - 38kb
  • Plus a couple of images (next month/previous month, which I'm pretty sure are sprited)

But that's not too bad...

alex
  • 479,566
  • 201
  • 878
  • 984
  • Don't worry, you can chop css pretty much. I wanted only to know what's the best method ;) – Ionuț Staicu Jun 16 '09 at 14:37
  • 68k....that is wrong, as is the 28k css theme... – redsquare Jun 26 '10 at 21:21
  • @redsquare things have probably changed since I posted this. Feel free to edit my answer. Thanks for letting me know too. – alex Jun 26 '10 at 23:54
  • for the datepicker only the total custom ui js is 38k minified, with gzip this is then considerably smaller – redsquare Jun 27 '10 at 07:47
  • I highly recommend avoiding jQuery datepicker for birth dates. I've attempted to use it, we had many complains from customers. First it was too difficult to go back more than a couple of years. (30 years requires 360 clicks with default settings). If you add the year selection, a lot of users would just click the day first, which hides the date picker without forcing to choose year. And then the user would go back and change only the year, not click the date, which wouldn't register the year change. Terrible experience. – Andrei Oct 13 '16 at 19:57
-3

I created three dropdowns for Date of Birth selection and number of days changes dynamically based on the year and month selection. http://jsfiddle.net/ravitejagunda/FH4VB/10/

daysInMonth = new Date(year,month,1,-1).getDate();