问题
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