Setting the value of date inputs on iPad

html, ipad, jquery, mobile-safari

Solution

Try this for Safari on iOS 5

 $('input[type="date"]').val('yyyy-MM-dd');

You could do the conversion from the type of Date you are using to `yyyy-MM-DD` in JavaScript using the `Date()` function.

Problem

WEB APP not native, no Objective-C This is so simple it hurts. ``` <input type="date" /> ``` Done to use the iPad native datepicker. Then setting the initial value with jQuery ``` $('input[type="date"]').val('Jun 25, 2012'); ``` Resulting in an empty input field. The jQuery above works great in ie7-9, chrome, safari, and FF, but not in iOS! I am out of ideas. Does anyone know a work around? Or why this happens?

Original source