Click to See Complete Forum and Search --> : Grrr


hooloovoo24
09-07-2004, 02:00 PM
OK here's where I stand. I've been trying to create a way for users to choose any date and be able to see what events are happening on that date. What i have so far is:

When a user clicks on a button, it opens a pop-up window which contains a javascript calendar with links on certain days. The users can scroll through different months with this.

What I need to know is, how do I program the links in the calendar to open not in the pop-up menu but in the original page with the button?

gil davis
09-07-2004, 02:09 PM
You can make any link in the calendar open in the other window by specifying:
<BASE TARGET="_parent">in the <HEAD> section of the popup.

hooloovoo24
09-07-2004, 02:10 PM
umm...I tried that, but it doesn't work.

gil davis
09-07-2004, 02:12 PM
NO, WAIT, I MADE A MISTAKE!

That was for frames.

You need to change the links to use this:
<A HREF="..." TARGET="_opener">

hooloovoo24
09-07-2004, 02:18 PM
erm...that's not quite workin' either. When I do that, it opens the page in a brand new window, not the original window.

artemis
09-07-2004, 02:30 PM
try,

<a href="link.htm" onclick="window.opener.location.href=this.href;return false;">link</a>

hooloovoo24
09-07-2004, 02:33 PM
thank you that's perfect

artemis
09-07-2004, 02:37 PM
no worries

hooloovoo24
09-07-2004, 02:44 PM
OK. Now, I'm having just a tad bit of trouble with these links. So the javascript code I have is:

var day = Calendar.getDate();
var todaysDate=false;
var done=false;
var LinkDay=[8, 15, 22];
var LinkSite=["committeeschedule.html/#9-08", "committeeschedule.html/#9-15", "committeeschedule.html/#9-22"];
for(var i=0; i<LinkDay.length; i++) {
if( LinkDay[i]==day ) {
if(LinkDay[i]!=today) {
cal +=TD_start +"<a href='LinkSite[i]' onclick='window.opener.location.href=this.href;return false;' >" + day +"</a>" + TD_end;
done=true;
}
else {
cal +=highlight_start +"<a href='http://www."+LinkSite[i]+"' onclick='window.opener.location.href=this.href;return false;'>" + day +"</a>" + highlight_end + TD_end;
todaysDate=true;
}
}
}

But that doesn't create the right links. I don't know what to do.

artemis
09-07-2004, 02:51 PM
what is the aim of the script, i.e. what do you want it to display?

artemis
09-07-2004, 02:54 PM
what does this line do?

#What is day meant to be, todays date? selected date?
var day = Calendar.getDate();

what is 'Calender'
its hard to know what it is that is wrong as not all the code is there and I dont know what the aim of it is.

hooloovoo24
09-07-2004, 06:12 PM
sorry...um...let's see

day would be today's date, I do believe...and the purpose of the script is to display a calendar with today's date highlighted, with links on the days specified with LinkDay. But the problem is in

cal +=TD_start +"<a href='LinkSite[i]' onclick='window.opener.location.href=this.href;return false;' >" + day +"</a>" + TD_end;


that ^^^ part of it. For some reason, the link doesn't come out with what was specified for LinkSite, it just puts in the words "linksite[i]" into the address bar.

gil davis
09-08-2004, 06:06 AM
You finally gave us the piece necessary to help you.
cal +=TD_start +"<a href='LinkSite[i]' onclick='window.opener.location.href=this.href;return false;' >" + day +"</a>" + TD_end;should be
cal +=TD_start +"<a href='" + LinkSite[i] + "' onclick='window.opener.location.href=this.href;return false;' >" + day +"</a>" + TD_end;

hooloovoo24
09-09-2004, 11:01 AM
thanks. Especially for the whole marble head thing. :)