jqery datepicker无效 [英] jqery datepicker is not working

查看:91
本文介绍了jqery datepicker无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用datepicker,当我点击文本框不工作时



 < ;! -     calendar    - >   

< link rel = stylesheet href = // code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css\">
< script src = // code.jque ry.com/jquery-1.10.2.js\"> < / script >
< script src = // code.jquery.com/ui/1.11.4/jquery- ui.js > < / script >
< link rel = 样式表 href = / resources / demos / style.css >





< script type =   text / javascript> 
$( function (){
$( #dob)。datepicker({
changeMonth: true
changeYear: true
});
});
< / script>





 <  输入    type   =  text    class   =  contacttxt    id   =  dob < span class =code-attribute>   name   =  dob     占位符  =  YYYY / MM / DD    value   =     size   =  10   >  

解决方案

function (){


#dob)。datepicker({
changeMonth: true
changeYear: true
});
});
< / script>





 <  输入    type   =  text    class   =  contacttxt    id   =  dob < span class =code-attribute>   name   =  dob     占位符  =  YYYY / MM / DD    value   =     size   =  10   >  


完美的工作 - [演示] DatePicker ChangeMonth和ChangeYear示例 [ ^ ]。



即使我添加了你在这里添加的相同代码作为HTML测试。这是工作。 HTML如下所示。

 <   html  >  
< head >
< link rel = < span class =code-keyword> stylesheet href = http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css >
< script src = http://code.jquery.com/jquery-1.10.2.js > < / script >
< script src = http://code.jquery.com/ui/1.11.4/jquery-ui.js\"> < / script >
< link rel = stylesheet < span class =code-attribute> href = / resources / demos / style.css >

< script type = text / javascript >

i am using datepicker and when i click on textbox not working

<!--calendar-->

 <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
 <script src="//code.jquery.com/jquery-1.10.2.js"></script>
 <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
 <link rel="stylesheet" href="/resources/demos/style.css">



 <script type="text/javascript">
$(function() {
  $( "#dob" ).datepicker({
    changeMonth: true,
    changeYear: true
  });
});
</script>



<input type="text" class="contacttxt" id="dob" name="dob"  placeholder="YYYY/MM/DD" value="" size="10" >

解决方案

(function() {


( "#dob" ).datepicker({ changeMonth: true, changeYear: true }); }); </script>



<input type="text" class="contacttxt" id="dob" name="dob"  placeholder="YYYY/MM/DD" value="" size="10" >


Perfectly works - [Demo] DatePicker ChangeMonth and ChangeYear Example[^].

Even I added the same code which you have added here and tested as a HTML. It is working. HTML is like below.

<html> 
<head>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
    <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
    <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css">

    <script type="text/javascript">


这篇关于jqery datepicker无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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