Adrian Adrian - 4 months ago 17
jQuery Question

How to display current variable of date to minDate using JQuery

I have a php variable for date that was from database that should be put in minDate.


Php Code

//Example variable in PHP that was from the database
$get_frm_database = "2016-10-20";



<input type="text" name="" id="datepicker">

$( function() {
$( "#datepicker" ).datepicker({
dateFormat: "yy-mm-dd",
minDate: "+7D", <----------This should be variable which is $get_frm_database
maxDate: "+1M",
showAnim: "show",
showOn: "button",
buttonImage: "date.png",
buttonImageOnly: true,
buttonText: "Select date"
} );

What I want is that the Php variable should be on minDate. Can someone help and show an example of codes? Thanks in advance.


Try to simply echoing it...

minDate: "<?php echo $get_frm_database; ?>",