Months and years
While I was in San Francisco for the last Event Apart of the year in December, Luke pulled me aside while he was preparing for his A Day Apart workshop on mobile web design. As befits the man who literally wrote the book on web forms and also wrote the the book on mobile-first design , Luke was planning to spend plenty of time covering input on mobile devices and he wanted my opinion on one of the patterns he was going to mention. Let’s say you’ve got your typical checkout form asking for credit card details. The user is going to need to specify the expiry date of their credit card, something that historically would have been done with select elements, like so: January February March April May June July August September October November December 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 With the introduction of the new input types in HTML5 , we can now just use input type=”month” . That’s particularly nice on mobile devices that support input type=”month” like Mobile Safari since iOS5. But the behaviour on non-supporting browsers would be to display just like input type=”text” …not ideal for inputting a date… Read the rest here