Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calendar Popup in jsp

 
Chitti pokala
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • 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..............
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • 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
  • 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
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where did you get this calendar?
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you done a View Source to make sure that your HTML file is as you expect?
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic