Hi DW, I have a back-end php file which is an engine for my site and a HTML file which is where the input is shown. the actual html code for the inputs is returned from the backend php file because it get customized there and returned with it data.
How this work is that a user first choose a date from a different date picker input, then the system do a post to my backend php file to retrieve relevant data and it will then return a datetime picker which a user has to now only set the time because we already know the date but at the moment a user is forced to also choose the date again now on the datetime picker input.
So I'm trying to attach the posted date picker input date to a datetime input element that is returned from backend, I'm trying to do this at the backend.This seems to be working if I set the value attribute of datetime picker to the posted value but the issue is that it is not shown inside the input element you still see mm/dd/yyyy --:--:-- but when you do an element inspection you can see the attribute value and the date.
What am I missing? Here is my code
//$searchDate has the posted date from a date picker input element
$rqt = $searchDate . " 00:00:00";// I don't want to set the time yet only the date as it is what we have at the moment
$yw = date("m/d/Y H:i:s", strtotime($rqt));
$xsearchDate = date("m/d/Y H:i:s",strtotime($yw));
// Now I'm setting up the datetime picker input element with this value
<div class='bootstrap-timepicker'><div class='form-group' ><div class='input-group'><input class='timein' onfocus='showthis();' type='datetime-local' class='form-control timepicker' value='".$xsearchDate."'><div class='input-group-addon'><i class='fa fa-clock-o'></i></div></div>