View Full Version : losing the onClick() event

01-12-2003, 05:01 PM
My menu builds a calendar on the screen using the .location parameter of an iframe. The calendar page includes javascript for several functions and it also includes a pop-up built from a div with a two row X 2 col table. One of the cells has the onclick event defined to close (hide) the div. When I run the page by itself it works fine but when it is used in the .location method (becomes a part of the main page) it can no longer find the defined javascript.

You can see it here http://www.ssscuba.com/testindex.html
Ignore the colors, I'll adjust later.

The first div is the pop-up window and the second Div is the calendar

<div id="popwin" Style="position:'absolute';visibility:'hidden';filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=90)'">
<table class="popup">
<TH width="60%" align="left" style="color:black;">Scheduled Functions</TH>
<TH style="width:40%;cursor:pointer;text-align:right;color:black;" onClick="parent.closeAppt()" Close</TH>
<TD colspan="2" id="Textspace" align="left" class="apptTxt" style="color:black;filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=95)'">This is the innerText
<!-- This is the space for the calendar -->
<div class="calSpace">
<iframe name="cal" frameborder="0" width="100%" height="100%" scrolling="auto">

testpage contains the closeAppt() function and the whole calendar is pasted into the testIndex html page.

If you call up testpage by itself it works fine.

Thanks for your help.

01-12-2003, 06:36 PM
Is that a direct copy and paste?

<TH style="width:40%;cursor:pointer;text-align:right;color:black;" onClick="parent.closeAppt()" Close</TH>

There is no close bracket for your TH tag (i.e. you need a > after your onclick). Other than that, I would simplify the onclick to just be something simple like an alert() box (for testing purposes) to make sure the onclick is the only possible problem.

01-12-2003, 07:51 PM
Yeah, there is a closing bracket. Just didn't type it correctly. I put an alert in the function but the function isn't being called. I get an object or method not suppported error. As I said, by itself (testpage.html) it works fine.


01-12-2003, 08:09 PM
That's beyond me. I set the visibility of the popwin div to 'visible' and set the onclick event to alert('blah') and it worked for me.

01-13-2003, 03:14 AM
Now I'm cornfused! I set an alert also and I can't even get there! Oh well, need to keep plugging away. Something may turn up.

Thanks for your help.