简体   繁体   English

日期选择器格式jQuery

[英]date picker format jquery

I try datepicker link link datepicker .. datepicker and i try this code 我尝试datepicker链接链接datepicker .. datepicker,然后尝试此代码

<input  ID="fromdate" value="dd/mm/yyyy" runat="server" clientidmode="static" />

when i try this code 当我尝试此代码

<script type="text/javascript">
    $(function () {
        $("#fromdate").datepicker();
        $("#todate").datepicker();
    });
  </script>

UPDATE 更新

now the problem is i also use table for data and for this i use this please check link data table and i add these links for date picker and table 现在的问题是我也使用数据表 ,为此,请检查链接数据表,并为日期选择器和表添加这些链接

<%--
for date--%>
<link rel="stylesheet"    href="https://code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css"/>
 <script type="text/javascript"   src="https://code.jquery.com/jquery-1.12.4.js"></script>
 <script type="text/javascript"  src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>

<%--for grid--%>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
<script src="Scripts/gridviewScroll.min.js" type="text/javascript"></script>

In table link there is also css file 在表格链接中也有css文件

<link href="Styles/gridviewScroll.css" rel="stylesheet" type="text/css" />

so when i remove css file datepicker work fine but when i add this css file then date picker look like this 所以当我删除css文件datepicker时工作正常,但是当我添加此css文件时,日期选择器看起来像这样

日期选择器图像

It is working fine. 一切正常。

Check the following js fiddle 检查以下js小提琴

https://jsfiddle.net/hLx9808w/ https://jsfiddle.net/hLx9808w/

<input  ID="fromdate" value="dd/mm/yyyy" runat="server" clientidmode="static" />

$(function () {
    $("#fromdate").datepicker();
    $("#todate").datepicker();
});  

It may be caused due to any jquery ui css override. 这可能是由于任何jquery ui css覆盖引起的。

The issue with table structure css. 表结构css的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM