jquery mobile date field default value not populating

<input type="date" name="logdate" id="logdate" value="11/15/2013" />

This is the HTML I'm using for a date field in Jquery mobile.

It's always blank on my iPhone with iOS7 with Safari.

Also always blank on my Android with Chrome

Populates as expected in Firefox, Chrome, etc. desktop

Is it possible to set the default value of a data field in jQuery mobile?

jQuery Mobile 1.3.2 jQuery 1.9.1

I've found around a half dozen articles suggesting javascript, etc. but none work and it seems like the "value" attribute should tag care of this.

Like this... this did not work:

How to set default current date using jquery mobile?

It works when you run it via jsFiddle on a desktop browser but not on the mobile browsers I have at my disposal.


This could a side effect of the HTML5 input type of date not being fully supported on all browsers yet. To check this see the CanIUse.com section for input of type date.

Another thing to look at is how you are trying to set the value of the date. According to the documentation the date must be in the format YYYY-MM-DD .

链接地址: http://www.djcxy.com/p/89982.html

上一篇: 使用框

下一篇: jQuery的手机日期字段默认值不填充