以引导模式形式显示日期选择器 [英] Display date picker in bootstrap modal form

查看:56
本文介绍了以引导模式形式显示日期选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以bootstrap模式形式显示datepicker但无法显示



< html lang =en> 
< head>
< meta charset =utf-8>
< meta name =viewportcontent =width = device-width,initial-scale = 1>
< title> jQuery UI Datepicker - 默认功能< / title>
< link rel =stylesheethref =// code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css\">
< link rel =stylesheethref =/ resources / demos / style.css>
< script src =https://code.jquery.com/jquery-1.12.4.js>< / script>
< script src =https://code.jquery.com/ui/1.12.1/jquery-ui.js>< / script>
< script>
$(function(){
$(#datepicker)。datepicker();
});
< / script>
< / head>
< body>

< p>日期:< input type =textid =datepicker>< / p>


< / body>
< / html>





这是显示日期选择器的简单页面

但是当我在header.php中包含所有标题样式,并将类datepicker设置为模态形式它没有发生



我尝试过:



模态在我的footer.php中,想在index.php中显示带有页眉和页脚的模态表单datepicker



< div id =myJodalclass =modal faderole =dialog> 
< div class =modal-dialog>



< div class =modal-content> 
< div class =modal-header>
< button type =buttonclass =closedata-dismiss =modal>< div id =orangeBox>
< span id =x> X< / span>
< / div>< / button>
< h4 class =modal-title>< h3 class =text-center>获取免费报价< / h3>< / h4>
< / div>
< div class =modal-body>



< div class =col-xs-6> ; 
< div class =form-group>
< label class =sr-onlyfor =city>旅行日期< / label>
< div class =input-group>
< div class =input-group-addon>< span class =glyphicon glyphicon-calendar>< / span>< / div>
< input type =textname =datepickerid =datepickerplaceholder =Date of Travelclass =form-control inputvalue =required =>
< / div>
< / div>
< / div>



< / div> 
< / div>

< / div>

< / div







请帮我解决问题

解决方案

(function(){


(#datepicker)。datepicker();
}) ;
< / script>
< / head>
< body>

< p>日期:< input type =textid =datepicker>< / p>


< / body>
< / html>





这是显示日期选择器的简单页面

但是当我在header.php中包含所有标题样式,并将类datepicker设置为模态形式它没有发生



我尝试过:



模态在我的footer.php中,想在index.php中显示带有页眉和页脚的模态表单datepicker



< div id =myJodalclass =modal faderole =dialog> 
< div class =modal-dialog>



< div class =modal-content> 
< div class =modal-header>
< button type =buttonclass =closedata-dismiss =modal>< div id =orangeBox>
< span id =x> X< / span>
< / div>< / button>
< h4 class =modal-title>< h3 class =text-center>获取免费报价< / h3>< / h4>
< / div>
< div class =modal-body>



< div class =col-xs-6> ; 
< div class =form-group>
< label class =sr-onlyfor =city>旅行日期< / label>
< div class =input-group>
< div class =input-group-addon>< span class =glyphicon glyphicon-calendar>< / span>< / div>
< input type =textname =datepickerid =datepickerplaceholder =Date of Travelclass =form-control inputvalue =required =>
< / div>
< / div>
< / div>



< / div> 
< / div>

< / div>

< / div







请帮我解决问题


I want to display datepicker in bootstrap modal form but unable to display

<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#datepicker" ).datepicker();
  } );
  </script>
</head>
<body>
 
<p>Date: <input type="text" id="datepicker"></p>
 
 
</body>
</html>



this is simple page which display date picker
but when i include all header style in my header.php and set class datepicker to modal form its not happening

What I have tried:

Modal is in my footer.php and want to display modal form datepicker in index.php with header and footer

<div id="myJodal" class="modal fade" role="dialog">
  <div class="modal-dialog">


 <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><div id="orangeBox">
    <span id="x">X</span>
</div></button>
        <h4 class="modal-title"><h3 class="text-center">Get Free Quotes</h3></h4>
      </div>
      <div class="modal-body">


<div class="col-xs-6">
          <div class="form-group">
            <label class="sr-only" for="city">Date Of Travel</label>
            <div class="input-group">
              <div class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></div>              
	      <input type="text" name="datepicker" id="datepicker" placeholder="Date Of Travel" class="form-control input" value="" required="">
            </div>
          </div>
          </div>


</div>
      </div>

      </div>

      </div




please help me to resolve the problem

解决方案

( function() {


( "#datepicker" ).datepicker(); } ); </script> </head> <body> <p>Date: <input type="text" id="datepicker"></p> </body> </html>



this is simple page which display date picker
but when i include all header style in my header.php and set class datepicker to modal form its not happening

What I have tried:

Modal is in my footer.php and want to display modal form datepicker in index.php with header and footer

<div id="myJodal" class="modal fade" role="dialog">
  <div class="modal-dialog">


 <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><div id="orangeBox">
    <span id="x">X</span>
</div></button>
        <h4 class="modal-title"><h3 class="text-center">Get Free Quotes</h3></h4>
      </div>
      <div class="modal-body">


<div class="col-xs-6">
          <div class="form-group">
            <label class="sr-only" for="city">Date Of Travel</label>
            <div class="input-group">
              <div class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></div>              
	      <input type="text" name="datepicker" id="datepicker" placeholder="Date Of Travel" class="form-control input" value="" required="">
            </div>
          </div>
          </div>


</div>
      </div>

      </div>

      </div




please help me to resolve the problem


这篇关于以引导模式形式显示日期选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆