我有一个来自数据库的日期的php变量应该放在minDate中。
示例:
Php Code
<?php
//Example variable in PHP that was from the database
$get_frm_database = "2016-10-20";
?>
HTML表单
<html>
<head>
</head>
<body>
Datepicker:
<input type="text" name="" id="datepicker">
<script>
$( 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"
});
} );
</script>
</body>
</html>
我想要的是Php变量应该在minDate上。有人可以帮助并显示代码示例吗?提前谢谢。
答案 0 :(得分:1)
尝试简单地回应它......
minDate: "<?php echo $get_frm_database; ?>",