dtdsbakn210537 2017-03-30 10:45
浏览 96

html5 DATE在Windows资源管理器和Firefox中不起作用

i been working on ticker reservation system and i used date function in forms but , which works fine on chrome but does not work on windows explorer and Firefox. what should i do?

departure date: <input type="date" name="departuredate"> departure time : <input type="time" name="departuretime"> arrival date : <input type="date" name="arrivaldate"> arrival time : <input type="time" name="arrivaltime">
  • 写回答

2条回答 默认 最新

  • drgweamoi473182981 2017-03-30 10:47
    关注

    You should use a third party date picker plugin which works on almost all browsers like JQuery UI Datepicker:

    See the demo below:

    https://jqueryui.com/datepicker/

      <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.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>
     
    <p>Date: <input type="text" id="datepicker"></p>

    How to use

    In the <head> </head> tags of your page insert the following lines:

      <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.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>
    

    Now create an input element which will be used as the datepicker like below:

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

    Now before closing the body tag (</body>) copy the following lines:

      <script>
      $( function() {
        $( "#datepicker" ).datepicker();
      } );
      </script>
    

    Or if you want you can copy these lines in the head tags as well, but I would recommend you put them here.

    </div>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计