douaikuai2715
2016-10-16 16:07
浏览 149

如何使用JQuery将日期的当前变量显示给minDate

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

Example:

Php Code

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

HTML Form

<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>

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

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongpou7275 2016-10-16 16:09
    已采纳

    Try to simply echoing it...

    minDate: "<?php echo $get_frm_database; ?>",
    
    已采纳该答案
    打赏 评论

相关推荐 更多相似问题