AndroidDev
AndroidDev

Reputation: 21237

HTML Input Type Date - Select and Collapse

When using an input type date in HTML5, after the user clicks on a date, the calendar stays expanded forcing them to click away from the calendar to make it collapse. I'd like for this to happen in a single click (i.e. when they click on the calendar, the date is recorded, the calendar collapses and they can get on to other business). Can anyone tell me how to do this? Thanks!

<label>Date</label>
<input type="date" id="my_date">

Upvotes: 0

Views: 6821

Answers (2)

alexander farkas
alexander farkas

Reputation: 14134

You could also use webshims, which polyfills incapable browsers and gives you nice custom widgets on top of HTML5 form inputs. Here is a demo, which includes some examples with different configurations.

webshims.polyfill('forms forms-ext');

Upvotes: 0

user2493235
user2493235

Reputation:

You could do it by using a jQuery plugin such as datepicker from jQuery UI: http://jqueryui.com/datepicker/

Upvotes: 1

Related Questions