Board Logo

'calendar1' is undefined - what am I doing wrong?
kamm - 12/4/2002 at 05:23 PM


I can't seem to figure this out. I'm trying to put two calendars on the one form one for a From: date and the other for a To: date.

I think I've followed your demo OK and I've tried putting your "demo - index.html" in same directory as my booking.htm to ensure that all the other files are in their correct place. The "demo - index.html" works fine from there so the mistake must be in my "booking.htm". I can't see where I'm going wrong. Any help would be appreciated.


I suppose the problem is within these snippets below, but I've included the entire page as an attachment.

......This is in the head..............

.....This is in the form.............
FROM:Click Here to Pick up the

TO:Click Here to Pick up the date

.............This is just under the closing form tag...........

andnapp - 4/9/2003 at 02:18 PM

This is just for reference: I looked at this as I am having a similiar problem that I will post in a different thread. I fixed this one to see if it was the same problem I was having: No dice.

There are two probems here. The first seems to be the unclosed <script statement above the calendar1 include.

<script language="JavaScript" type="text/JavaScript">

^---Remove this line......
<!-- European format dd-mm-yyyy -->
<script language="JavaScript" src="calendar1.js"></script>
<!-- Date only with year scrolling -->

The second problem is that you need to define a diferent calendar object for your second control.

<script language="JavaScript">
<!-- // create calendar object(s) just after form tag closed
// specify form element as the only parameter (document.forms['formname'].elements['inputname']);
// note: you can have as many calendar objects as you need for your application
var cal1 = new calendar1(document.forms['enquiry'].elements['input1']);
cal1.year_scroll = true;
cal1.time_comp = false;
//V----add me
var cal2 = new calendar1(document.forms['enquiry'].elements['input2']);
cal1.year_scroll = true;
cal1.time_comp = false;

zeevr - 6/25/2008 at 03:30 PM

Hi ,
I have the simillar problem ?

My perl+CGI call calendar1.js

Could you help me ?

Attached my perl

Back to forum: