Jquery datepicker not working, date field not showing

I'm trying to add jquery dtepciker to my application in Grails (Intelli J) but datepicker won't show it

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'm new to jquery / jaa script, if you could tell me where I am wrong, I need to have jquery datepicker plugin in my application and if so, how to set that

Also, when I hang this this .datepicker (); he says "unresolved function or datepicker () method"

thanks

+4
source share
2 answers

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

Download js and include on your page.

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

Also check jQuery DatePicker without loading , this may help.

+3
source

I think it should be:

 $("#datepicker").datepicker(); 
+1
source

Source: https://habr.com/ru/post/1379845/


All Articles