Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Textfield of type date for android

I am creating a HTML5 app for android.

I am using jQuery mobile with following headers:

<link rel="stylesheet" href="../../lib/jquery.mobile-1.3.0.min.css" />
<script src="../../lib/jquery-1.8.2.min.js"></script>    
<script src="../../lib/jquery.mobile-1.3.0.min.js"></script>

and I add the input field as described at jQuery mobile's demo site:

<input type="date" data-clear-btn="false" name="date-1" id="date-1" value="">

However, instead of the datepicker I just get a textbox.

Am I missing something?

like image 441
Daniel Avatar asked Feb 17 '23 04:02

Daniel


1 Answers

First only Chrome will show datapicker component. Other desktop browsers will fail so don't rely on this implementation.

Second thing, jQuery Mobile don't have datepicker component. So you will need to use a 3rd party plugin. Don't rely on jQuery UI datepicker plugins because they are not optimized for mobile usage.

Better use some of there 3rd party jQuery Mobile plugins:

Datebox

and

Mobiscroll

Here are some of my answers and examples how to use jQM datapickers:

How to show datepicker on field focus only?

Datepicker for jQuery mobile (Android)

like image 92
Gajotres Avatar answered Feb 28 '23 06:02

Gajotres