jquery datepicker not working ,date box not appearing

爷,独闯天下 提交于 2021-01-27 07:08:19

问题


i am trying to add jquery dtepciker to my application in Grails(Intelli J) but its not showing the datepicker

here is my html code

           <input type="text" id="datepicker" name="datepicker" style="width:275px"       value="enter date">

here is my javascript code

                    $(document).ready(function(){

                   $("#datepicker").datepicker();
                    });t

but when i click on the text box : datepicker nothing happens , i am new to jquery/ jaa script if you could tell me where i'm wrong , do i need to have the jquery datepicker plugin in my application and if yes , how to install that

Also when i mouseover this .datepicker(); it says "unresolved function or method datepicker()"

Thank


回答1:


Yes you need to have jquery and jquery-ui datepicker plugin to make this work. You can download the plugin from http://jqueryui.com/download

Download the js and include in your page.

One more thing, $("datepicker").datepicker(); should be $("#datepicker").datepicker();

Also check out jQuery DatePicker not Loading, it might help.




回答2:


I think it should be:

$("#datepicker").datepicker();


来源:https://stackoverflow.com/questions/8025770/jquery-datepicker-not-working-date-box-not-appearing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!