• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Calendar Popup in jsp

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I am trying to use Calendar Popup in my JSP. But I am getting an error
cal is null or not an object

< script type="text/javascript" language="Javascript" src="<%=request.getContextPath()%>/js/calendarPopup.js"></script>
<SCRIPT LANGUAGE="JavaScript">

var cal = new CalendarPopup();
cal.showYearNavigation();
cal.showYearNavigationInput();

</SCRIPT>

<INPUT TYPE="text" NAME="date1" VALUE="18-Jan-2005" SIZE=25>
<A HREF="#" ="cal.select(date1,'anchor1','dd-NNN-yyyy'); return false;" NAME="anchor1" ID="anchor1"><img src="images/cal.gif" width="16" height="16" ></A>

Please let me know where I am wrong..............
 
Sheriff
Posts: 67746
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

Please let me know where I am wrong



Most recently, posting in the wrong forum. The Javascript on your page has little to do with the JSP that generated it. Moving to the HTML/Javascript forum.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the error? Where did you find the code? Is the js file linked correctly?

Eric
 
Chitti pokala
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, the js file linked well. I am that variable cal is null or not an object.

Please let me know....
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
where did you get this calendar?
 
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well if you know that the js file is linked correctly, the problem has to be inside the js file itself.

-Yuriy
 
Chitti pokala
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is not with the js file because I am using the same js for normal html and it works fine. And I include this in my jsp its not working..........
 
Bear Bibeault
Sheriff
Posts: 67746
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
Have you done a View Source to make sure that your HTML file is as you expect?
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

< script type="text/javascript" language="Javascript" src="<%=request.getContextPath()%>/js/calendarPopup.js"></script>
<SCRIPT LANGUAGE="JavaScript">



The js file name is calendarPopup.js and

var cal = new CalendarPopup();



Is this correct?
reply
    Bookmark Topic Watch Topic
  • New Topic