Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jsp + popup calendar

Status
Not open for further replies.

Kendel

Programmer
Apr 24, 2002
1,512
US
Hi all,

This is a jsp + javascript problem. I'm trying this forum first, if you tell me it's wrong forum, I will move my thread to javascript forum. Thanks.

I found this link:

Followed this link to get the js file:
then inserted it to my project.
In my jsp:
Code:
<link rel="stylesheet" type="text/css"
href='<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/theme/stylesheet.css") %>'>
<script language="JavaScript" ID="jscal1xx">
	var cal1xx = new CalendarPopup("testdiv1");
	cal1xx.showNavigationDropdowns();
</script>

<INPUT TYPE="text" NAME="date1xx" VALUE="" SIZE=25>
<A HREF="#" onClick="cal1xx.select(document.forms[0].date1xx,'anchor1xx','MM/dd/yyyy'); return false;" TITLE="cal1xx.select(document.forms[0].date1xx,'anchor1xx','MM/dd/yyyy'); return false;" NAME="anchor1xx" ID="anchor1xx">select</A>

When I run the project, in my jsp, I keep getting the error: "CalendarPopup is undefined"
I checked the script the the function CalendarPopup was there. What did I do wrong? Do you know any link more simple than this one? Thank you so much.
 
I'm sorry, cut & paste error. It's not .css file, it should be .js file like this:

Code:
<link rel="stylesheet" type="text/css"
href='<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/theme/CalendarPopup.css") %>'>
 
I'm sorry again, here is the correct one:
Code:
<link rel='javascript' type="text/css"
	href='<%= renderResponse.encodeURL(renderRequest.getContextPath() + "/theme/PopupCalendar.js") %>'>

still doesn't work.
 
I think this is more a javascript issue: I'd take a look at the html code generated by the jsp (view source). Maybe you're not including the js file.

Cheers,
Dian
 
You are correct, I was not including the file. I must use the script tag instead of link. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top