I have read alot here, and figured out a lot of solutions from the posts. This is my first question. I hope I do well.
I am using the datetime-local input type from: http: jquerymobile.com /demos/ 1.2.1 /docs /forms /textinputs/
I want to prefill it with the datetime from my database (using mysql and php)
Problem is I get a value in the field and no datetime picker or I get no value and the datetime picker will popup.
1. I can't seem to find the documentation that describes how to prefill it. I am overlooking it? 2. Can someone help me resolve this?
~=-=-=-=-=-=~
My test code is as follows.
<div data-role="fieldcontain">
<label for="datetime-l">Datetime local:</label>
<input type="datetime" name="datetime-l" id="datetime-l" value="<?php
$date1 = new Datetime($rrecord->strval('datenote'));
echo $date1->format(DateTime::ISO8601);
?>" />
</div>
<div data-role="fieldcontain">
<label for="datetime-2">Datetime local:</label>
<input type="datetime-local" name="datetime-2" id="datetime-2" value="<?php echo $rrecord->strval('datenote') ?>" />
</div>
The first field is filled with a date, but no datetime picker will pop up when touching it.
see linked screenshot -- http://picpaste.com/2013-09-12_21.45.11_1.png
The second field is empty, but a datetime picker pops up when touched.
see linked screenshot -- http://picpaste.com/2013-09-12_21.45.19.png
This is the debug code that echos the inputs. They show on the first screenshot.
<?php echo "debug datetime prefill from database"; ?>
<?php
echo "<br/>rrecord strval('datenote') = ", $rrecord->strval('datenote');
$date1 = new DateTime($rrecord->strval('datenote'));
echo "<br/> date1 format(DateTime::ISO8601) = ", $date1->format(DateTime::ISO8601);
?>