如何在文本框中单击显示jquey datepicker [英] how to show a jquey datepicker in textbox click

查看:68
本文介绍了如何在文本框中单击显示jquey datepicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i需要点击文本框中的日期选择器。





现在我写了以下代码:



in html:



Hi,
i need a datepicker in the click of textbox.


Now i have written the following code:

In html:

<link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.css")" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery-1.7.1.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-1.7.1.min.js"type="text/javascript"></script>
    <script src="../../Scripts/jquery-ui-1.8.20.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-ui-1.8.20.min.js" type="text/javascript"></script>







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





在knockout.js:



In knockout.js:

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







但它不起作用请指导我这样做。



谢谢




But it is not working please guide me to do this.

Thank You

推荐答案

(function(){
(function () {


( #datepicker)。datepicker();});
("#datepicker").datepicker(); });







但它不起作用请指导我这样做。



谢谢




But it is not working please guide me to do this.

Thank You


问题



1.您已经将jQuery文件包含了两次。删除一个。

Problems

1. You have included the jQuery files two times. Remove one.
<script src="../../Scripts/jquery-1.7.1.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-1.7.1.min.js"type="text/javascript"></script>





2.你已经两次包含了jQuery UI js。删除一个。



2. You have included jQuery UI js two times. Remove one.

<script src="../../Scripts/jquery-ui-1.8.20.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.20.min.js" type="text/javascript"></script>





3。你已经两次包含了jQuery UI css。删除一个。



3. You have included jQuery UI css two times. Remove one.

<link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/themes/base/jquery.ui.css")" rel="stylesheet" type="text/css" />





解决方案



参考 - Datepicker [ ^ ]

检查包含的文件及其工作原理。尝试如下...



Solution

Refer - Datepicker[^]
Check what are the files included and how it is working. Try like below...

<!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css" />
  <script>


这篇关于如何在文本框中单击显示jquey datepicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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