• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jQuery datepicker JSP question

 
Nicolas Constanzo
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am currently trying to add a datepicker to my website using a Tomcat/Hibernate/jsp environment.
The problem is that I can't seem to be able to load the datepicker function. When I create an empty jsp to try it out it works. Like so:



But when I try to implement it on my webpage it won't work. It currently uses a Servlet to load some information for <select> option boxes. Here is some of the code for this jsp:





Any reason why this wouldn't work? I'm guessing it might be a problem with Tomcat but I'm not sure. Any help would be greatly appreciated.

Thanks,
Nick
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

As jQuery is entirely a client-side technology, the issue must be with the HTML that is being sent to the browser. Therefore, the JSP source is not very useful. Rather, please inspect the rendered HTML as it is sent to the browser to see what might be awry.

Also, just saying "it doesn't work" isn't very helpful. What did happen?
 
Nicolas Constanzo
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the lack of information on my initial post. It's the first time I post a question on a forum
What I expect to happen is that I want the jQuery datepicker calendar to show up when I click on the input field but when I load the webpage from Safari, locally, using localhost:8080, if I click on the input field the calendar doesn't pop up, it just shows as a blank input field.
What should I be looking for in the rendered HTML to find out what is not working?

Thanks,
Nick
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cannot say. Nothing jumps out at me by looking at the JSP source -- frequently page-relative addressing of the script files is a culprit, but not in this case as you are using absolute urls to the google CDN.

Initially, grab the HTML and inspect it for correctness and make sure that what you think should be there is there.

If all looks well, then it is time to start further debugging. For example, making sure that the ready handler is firing as expected. You might have to end up cutting away chunks until you can find what's causing things to boof up.
 
Nicolas Constanzo
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I did what you said and created a temp.jsp and slowly added the pieces of my html code. Turns out I was already loading a different version of jquery at the bottom of the page, so it was trying to load it twice!

and at the end of the page:

Couldn't believe I missed that.

Thanks so much for your help.
Nick
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic