473,226 Members | 1,660 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

popup calendar


Hi all,

New to developing in VS 2005 ASP 2.0

Trying to have a easy pop calender for a button on a web page.

I keep getting a error message in IE6 that says:
Line 69
Char 3
Error: 'this.container' is null or not an object

In red I put an arrow at line 69 in the js file

I'm using Nick Baicoianu code that I got off the web.

I've in closed the code with *** where I have put the function to reference
js file?

this is how i'm using it:

In a js file I have this:

/************************************************** ***************************
Copyright (C) 2006 Nick Baicoianu

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
************************************************** ***************************/
//constructor for the main Epoch class (ENGLISH VERSION)
function Epoch(name,mode,targetelement,multiselect)
this.state = 0;
this.name = name;
this.curDate = new Date();
this.mode = mode;
this.selectMultiple = (multiselect == true); //'false' is not true or not
set at all

//the various calendar variables
//this.selectedDate = this.curDate;
this.selectedDates = new Array();
this.cells = new Array();

//The controls

//standard initializations
this.mousein = false;
this.displayYear = this.displayYearInitial;
this.displayMonth = this.displayMonthInitial;

this.createCalendar(); //create the calendar DOM element and its children,
and their related objects

if(this.mode == 'popup' && targetelement && targetelement.type == 'text')
//if the target element has been set to be an input text box
this.tgt = targetelement;
this.calendar.style.position = 'absolute';
this.topOffset = this.tgt.offsetHeight; // the vertical distance (in
pixels) to display the calendar from the Top of its input element
this.leftOffset = 0; // the horizontal distance (in pixels) to
display the calendar from the Left of its input element
this.calendar.style.top = this.getTop(targetelement) + this.topOffset +
this.calendar.style.left = this.getLeft(targetelement) + this.leftOffset +
this.tgt.calendar = this;
this.tgt.onfocus = function () {this.calendar.show();}; //the calendar
will popup when the input element is focused
this.tgt.onblur = function ()
{if(!this.calendar.mousein){this.calendar.hide();} }; //the calendar will
popup when the input element is focused
this.container = targetelement;
this is line 69 -->> }

this.state = 2; //0: initializing, 1: redrawing, 2: finished!
this.visible ? this.show() : this.hide();


In another js file I have this:

// JScript File
var bas_cal, dp_cal, ms_cal; /*must be declared in global scope*/
/*put the calendar initializations in the window's onload() method*/
window.onload = function() {
bas_cal = new
Epoch('epoch_basic','flat',document.getElementById ('basic_container'));
ms_cal = new
Epoch('epoch_multi','flat',document.getElementById ('multi_container'),true);
dp_cal = new
Epoch('epoch_popup','popup',document.getElementByI d('popup_container'));
and in my master page I have this:

<%@ Master Language="VB" CodeFile="MainMasterPage.master.vb"
Inherits="MainMasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<link rel="stylesheet" type="text/css" href="javascript/epoch_styles.css"
/> <!--Epoch's styles-->
<script type="text/javascript" src="javascript/epoch_classes.js"></script>
<!--Epoch's Code-->
<script type="text/javascript"
src="javascript/my_declarations.js"></script> <!--Epoch Declarations-->

<form id="form1" runat="server">
<div style="background-color: #6f9a64">
<table border="0" cellpadding="0" cellspacing="0" style="width:
100%; height: 100%" id="MainTable" runat="server">
<td colspan="2" style="height: 87px; background-image:
url(images/maingrad2.JPG); border-bottom-color: #006600;">

<img id="imageheader"
style="z-index: 100; left: 53px; width: 101px; position:
absolute; top: 25px;
height: 66px; -moz-opacity:70%;
filter:alpha(opacity=75); opacity:0.75"
alt="Helicoverpa Armigera"
<div style="z-index: 101; left: 336px; width: 246px;
color: black; position: absolute;
top: 78px; height: 24px">
<span id="ctl00_Label1" style="font-weight: bold;
font-size: 1.4em; color: #404040;
font-family: Arial">PPQ Eastern Region</span>
<asp:SiteMapDataSource ID="SiteMapDataSource1"
runat="server" ShowStartingNode="False" />

<td colspan="3" style="border-right: #003300 thin solid;
border-top: #999999 thin solid;
font-weight: bold; font-size: 12px; border-bottom-color:
#006600; color: gray;
height: 9px; background-color: #aec7a9; text-align: left
" id="Celldate">
<asp:Label ID="datelbl" runat="server"
<asp:Label ID="hostlbl" runat="server" Width="40%"


<td style="width: 157px; vertical-align: top; border-right:
#003300 thin solid; background-color: #ffffff; text-align: left; border-top:
#003300 thin solid; border-left: #003300 thin solid; position: relative;
height: 78%;">

<asp:Menu ID="Menu1" runat="server"
DataSourceID="SiteMapDataSource1" Width="100%" Height="90px"
style="font-weight: normal; font-size: large; font-family: Verdana;
background-color: white; padding-left:
5px; border-top-style: none;
border-right-style: none; border-left-style: none; border-bottom-style: none;
width: 100%;" Font-Names="Verdana" ForeColor="#404040" Font-Bold="True"
Font-Size="Medium" BorderColor="Black" BorderStyle="Solid">
<StaticHoverStyle BackColor="#A1BC99"
BorderColor="White" ForeColor="#404040" />

************************************************** ***
<input id="popup_container" type="text" />
<input type="button" value="pick" onclick="dp_cal.toggle();" />

************************************************** **
<td style="background-color: #ffffff; vertical-align: top;
font-size: large; border-left-color: #006600; color: black; font-family:
Arial; table-layout: fixed; border-top: #003300 thin solid; height: 78%;
width: 618px; position: static;">
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
<br />
<br />

<br />
<td colspan="2">


Jun 19 '06 #1
0 1974

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Caesar Augustus | last post by:
I'm having a problem with two different javascript controls in my app. The first chuck of javascript that I pasted into my app is the client-side calendar control popup which works fine when first...
by: Ali | last post by:
i am using visual studio 2005 and I am trying to create a popup calender so when a user click on a image on the main form, a calender will then popup, the user will select a date and the date will...
by: Peter | last post by:
Does anyone have an example of how you would do a popup window when a user clicks on a day number link in the ASP.NET Web Calendar control? I am trying to create an event calendar similar to how...
by: Garth Wells | last post by:
I found sample code that shows me how to implement a popup calendar, but I would like the calendar to popup at the lower right of the Input to which it's associated...the way Sharepoint popup...
by: R.A.M. | last post by:
Hello, I need to implement popup calendar in ASP.NET application. I created a button opening popup calendar on 'master' page: <asp:Button ID="Calendar" runat="server" Text=Calendar"...
by: R.A.M. | last post by:
Hello, I need to implement popup calendar in ASP.NET application. I created a button opening popup calendar on 'master' page: <asp:Button ID="Calendar" runat="server" Text=Calendar"...
by: rockdale | last post by:
Hi, I tried to search web for an non-popup calendar control, (like javascript calendar) but could not find a good solution. Most solutions are popup another window and show the calendar, then...
by: ShyGuy | last post by:
A while back I had found a link to a popup calendar that had a small button that was placed to the right of any text box. By clicking on the icon and selecting a date the text box was updated with...
by: mikaint | last post by:
I'm really confused here...i'll need some help with the following... i have a sceipt that will open a popup win which is actually a calendar and i'm trying to apply a style on the popup... Here's...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.