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.
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?
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?
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.
Joined: Jul 10, 2011
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!