Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

jQuery datepicker JSP question

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic