brian01bwa
Newbie
Posts: 1
Registered: 2/26/2003
Member Is Offline
|
| posted on 2/26/2003 at 04:17 AM |
|
|
Calender Object Errors
I have a test page and all .js files in same directory, but am getting a "cal" is undefined. I am just starting with JavaScript. Can
anyone tell me what I else I need to do? Some of this setup came from another post. Thanks.
<head>
<title>Calender test</title>
<script language="JavaScript" SRC="calendar1.js">
</head>
<body>
<p> </p>
<form name="caltest" method="POST" action="anotherform.cgi">
<script language="JavaScript">
var cal = new calendar1(document.forms['getDate'].elements['date']);
</script>
<p>Calendar test </p>
<p><input type="text" name="date" value="" size="20"> <a
href="javascript:cal.popup();"><img border="0" src="images/cal.gif" alt="Click here to select access a
calender" width="16" height="16"></a></p>
<p> </p>
<p><input type="submit" value="Submit" name="B1"></p>
</form>
|
|
|
tigra
Administrator
Posts: 1926
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 3/8/2003 at 12:02 PM |
|
|
1. Move calendar initialization block out of the form. Put it just after closing </form> tag
2. In calendar constructor you specify document.forms['getDate'] while name of the form is 'caltest' (not 'getDate')
|
|
|