Board Logo

Calendar Pro error
pdd_2003_1 - 8/9/2007 at 08:25 AM

I copied the files in the tigra_calendar_propopup_mode folder to the server and created a simple page using the example from the documentation as shown below.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<img src="img/cal.gif" name="an_img" onclick="A_CALENDARS[0].showcal()">

<form name="a_form">

<input type="Text" name="control1" id="control1">

<script language="JavaScript">
var CAL_INIT = {

'controlname': 'control1',
'picttype': 'img',
'pictname': 'an_img',
'formname': 'a_form',

new calendar(CAL_INIT, CAL_TPL1);


The page opens but with errors. I cannot work out what is missing. Anyone able to help?

tigra - 8/9/2007 at 03:25 PM

The sample you used is for modal mode, not pop-up mode calendar.
If you want to use pop-up version with the existing input box then use method .popup() instead of .showcal()

here is the sample code that uses pop-up calendar with pre-existing input box as you wanted:


<title>JavaScript Calendar</title>
<script language="JavaScript" src="cal_tpl.js"></script>
<script language="JavaScript" src="cal_strings.js"></script>
<script language="JavaScript" src="calendar.js"></script>
<link rel="stylesheet" href="calendar.css">
<script language="JavaScript">

// initial calendar settings structure
var CAL_INIT1 = {
'formname' : 'test_form',
'controlname' : 'controlname',
'watch' : true,
'dataformat' : 'm/d/Y'

<form name="test_form">
<input name="controlname" value="08/06/2002">
<script language="JavaScript">
new calendar(CAL_INIT1, CAL_TPL);

Back to forum: