View Full Version : Need help with Basic Calendar Script

03-06-2006, 11:20 PM
Basic Calendar Script:

I have been working on making my site universally friendly...even though I have FrontPage 03 as my editor. So I have been experimenting with adding java script.

I believe I followed the directions for this script but I get missing object errors. I put the uploaded the .js file but am not sure if it is in the correct spot.

03-07-2006, 05:52 AM
To check on that we need a link to your page:

PLEASE: Include the URL to your problematic webpage that you want help with.

FrontPage itself can often mangle scripts, if that is the case, read on:

Well, you might be able to configure FP so as to allow you to insert code like this without it mangling it so much. Read the manual or Google for help on that. Another alternative, and what I recommend in all cases like this, is to get your page looking like you want using FP but without any scripts. Save a copy of that somewhere to work on later if the need arises. Next open the page in notepad or simple text and add the scripts in according to the installation instructions, including any customization you've added. Never load this version of the page into FP ever again. To preview it locally, use the browser. To upload it, use FTP (preferred) or your host's online uploading tool.

Here is another solution I ran across* but, since I do not use FP, I haven't tested it:

In a text editor open the page whose code you which to preserve.

At the beginning of the section of code you which to prevent FrontPage from modifying, add the following line of code:

<!--webbot bot="HTMLMarkup" startspan -->

At the end of the code section, add the following line of code:

<!--webbot bot="HTMLMarkup" endspan -->

Save the changes to the file. The next time the file is opened in FrontPage, FrontPage will not attempt to alter the code between the two HTMLMarkup tags.

*Posted in these forums by usace-lrc and perhaps others.

03-07-2006, 01:02 PM
I thought about moving back and forth using notepad...I often have to paste information in notepad to remove formatting before pasting it in FP.

The website (page) in question is:


The actual page is similar, remove "test"

Thanks for your VERY THOROUGH response!

03-07-2006, 02:07 PM
Looking at your source code, it looks as though you either didn't follow the directions or FP did something to your code to mangle it. Actually, since both script call:

<script type="text/javascript" src="basiccalendar.js">

* Basic Calendar-By Brian Gosselin at http://scriptasylum.com/bgaudiodr/
* Script featured on Dynamic Drive (http://www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code


and calendar style:

<style type="text/css">

.main {
border:1px solid black;

.month {
font:bold 12px verdana;

.daysofweek {
font:bold 12px verdana;

.days {
font-size: 12px;
background-color: lightyellow;
padding: 2px;

.days #today{
font-weight: bold;
color: red;


are missing entirely from the head of the document, it looks like you skipped some steps. Once those are remedied, it will become apparent where the calendars are and you might (will) wish to change that. The calendar calls:

<script type="text/javascript">

var todaydate=new Date()
var curmonth=todaydate.getMonth()+1 //get current month (1-12)
var curyear=todaydate.getFullYear() //get current year

document.write(buildCal(curmonth ,curyear, "main", "month", "daysofweek", "days", 1));

and similar are like divisions or tables, place them in your HTML markup like you would a division or table, not in the head.

One other thing the drop down select appears not to be working even if the script call and style are added. I'm not sure why this is happening but, once again (for whatever reason) your code does not reflect the example for this.

This bit in your source:

<applet width="128" height="128" code="basiccalendar.js">

doesn't belong and the form tag is missing from around the script and select tag while instead it is wrapped in this link, causing it to load your index page when clicked:

<a href="index.shtml">

Even taking care of all that, there is still some error as all it then seems to do is switch to January, no matter what month is selected.

Perhaps you should start by just trying to get one calendar working with no selects or other frills.

03-07-2006, 03:09 PM
You're lucky (unless you really wanted to learn to do this yourself), I played around with this a bit more and came up with this demo (http://home.comcast.net/~jscheuer1/side/trout_h.htm), use your browser's 'view source' to see (and copy, if you like) the code.

03-07-2006, 06:46 PM
I do want to play around with it myself, and will, but your time solved my immediate concern. You have my contact information...if you are ever in the area and want to fish, look me up. Your help is worth a three hour "fish with your guide" trip.