在jQueryModel对话框中显示jQuery日期选择器

在jQueryModel对话框中显示jQuery日期选择器,jquery,jquery-ui,jquery-ui-datepicker,jquery-dialog,Jquery,Jquery Ui,Jquery Ui Datepicker,Jquery Dialog,在模式对话框中显示日期选择器似乎有问题 我正在使用: $(".dpicker").datepicker({ numberOfMonths: 2, dateFormat: 'd M yy', showButtonPanel: true }); 在给定的输入字段上启用日期选择器 请检查小提琴: 除了在模态对话框中渲染外,它正在工作 有什么建议可以让日期选择器在对话框中工作吗 请不要标记为重复,因为我在整个internet上搜索了一个

在模式对话框中显示日期选择器似乎有问题

我正在使用:

    $(".dpicker").datepicker({
        numberOfMonths: 2,
        dateFormat: 'd M yy',
        showButtonPanel: true
    });
在给定的输入字段上启用日期选择器

请检查小提琴:

除了在模态对话框中渲染外,它正在工作

有什么建议可以让日期选择器在对话框中工作吗


请不要标记为重复,因为我在整个internet上搜索了一个有效的解决方案,但它们似乎都不起作用。

尝试使用JQuery UI datepicker。请参阅下面的代码片段():

HTML代码:

<p>HTML5 Date: <input type="date" placeholder="html5 date:" /></p>

<p><input id="Button1" type="button" value="Get DatePicker Value" title="Get DatePicker Value" /></p>
谢谢

~Chandan

为什么不使用像这样的弹出窗口呢。您可以在上看到完整的api

它看起来是这样的:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>
</head>
<body>

<p>Date: <input type="text" id="datepicker"></p>


</body>
</html>

当您在输入字段中单击时,它将显示如下对话框

您的代码如下所示:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>
</head>
<body>

<p>Date: <input type="text" id="datepicker"></p>


</body>
</html>

jQuery UI日期选择器-默认功能
$(函数(){
$(“#日期选择器”).datepicker();
});
日期:


通过将包含的jQuery UI JS和CSS文件(外部资源)替换为以下内容,我可以让datepicker在小提琴中工作:

//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css


//code.jquery.com/ui/1.11.4/jquery ui.js

这不是我想要的。我需要让它显示在一个模态对话框中,否则就很容易了。检查我的小提琴,已经做了您所做的。@LiviuValentin或使用引导在模式内显示日期选择器,请参阅此链接:我需要使用jquery UI模式对话框和日期选择器,而不是引导。是的,但我的问题是在jquery UI模式窗口中显示jquery UI日期选择器不起作用。否则它就起作用了。