Javascript或Jquery中的日期和时间选择器 [英] Date and time picker in Javascript or Jquery

查看:54
本文介绍了Javascript或Jquery中的日期和时间选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在开发一个联系我们表格。在那里,我需要获得From日期与时间和日期以及时间。任何人都可以提供我在我的asp .net Web应用程序中实现它的代码。在此先感谢。

Hi all,
I am developing a contact us form . In that i need to get the From date with time and To date along with time.Can anyone provide me the code for implementing this in my asp .net web application. Thanks in advance.

推荐答案

<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title>jQuery Datepicker Demo</title>
    <style type="text/css">
        div.ui-datepicker
        {
            font-size: 10px;
        }
    </style>
    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/start/jquery-ui.css" type="text/css" media="all" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js" type="text/javascript"></script>
    <script type="text/javascript">


(document).ready (function(){
(document).ready(function () {


('#txtDateFrom,#txtDateTo')。datepicker({
changeYear:true,
beforeShow:function(textbox,instance){
instance.dpDiv.css({
marginTop:( - textbox.offsetHeight)+'px',
marginLeft:textbox.offsetWidth +'p x'
});
}
});
});
< / script >
< / head >
< body > ;
< 表格 id = testForm runat = server >
< div >
< 输入 类型 = text id = txtDateFrom / > < br / >
< 输入 type = < span class =code-keyword> text id = txtDateTo / >
< < span class =code-leadattribute> / div
>
< / form >
< / body >
< ; / html >
('#txtDateFrom,#txtDateTo').datepicker({ changeYear: true, beforeShow: function (textbox, instance) { instance.dpDiv.css({ marginTop: (-textbox.offsetHeight) + 'px', marginLeft: textbox.offsetWidth + 'px' }); } }); }); </script> </head> <body> <form id="testForm" runat="server"> <div> <input type="text" id="txtDateFrom" /><br /> <input type="text" id="txtDateTo" /> </div> </form> </body> </html>







我已经创造了这个。我可以得到日期,但我无法找到jquery中的任何工具是否有任何此类工具可用于获取时间。我只想要一些参考链接。




Hi ,I have created through this. I can get the date but i am not able to find any tool in jquery whether any such tool available for getting time also. Am just asking for some reference links if possible.


这篇关于Javascript或Jquery中的日期和时间选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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