Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Posts
    567
    Thanks
    2
    Thanked 4 Times in 4 Posts

    losing the onClick() event

    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

    Code:
    <div id="popwin" Style="position:'absolute';visibility:'hidden';filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=90)'">
    <table class="popup">
    <THEAD>
    <TR>
    <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>
    </TR>
    </THEAD>
    <TBODY><TR>
       <TD colspan="2" id="Textspace" align="left" class="apptTxt" style="color:black;filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=95)'">This is the innerText
     </TD>
    </TR>
    </TBODY>
     </Table>
    </div>
    <!-- This is the space for the calendar -->
    <div class="calSpace">
    	 <iframe name="cal" frameborder="0" width="100%" height="100%" scrolling="auto">
    	 </iframe>
    </div>
    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.
    Scott Stewart
    Always happy to learn from pros.

  • #2
    Regular Coder
    Join Date
    Jan 2003
    Posts
    867
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Is that a direct copy and paste?

    Code:
    <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.

  • #3
    Regular Coder
    Join Date
    Nov 2002
    Posts
    567
    Thanks
    2
    Thanked 4 Times in 4 Posts
    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.

    Thanks
    Scott Stewart
    Always happy to learn from pros.

  • #4
    Regular Coder
    Join Date
    Jan 2003
    Posts
    867
    Thanks
    4
    Thanked 8 Times in 8 Posts
    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.
    Last edited by arnyinc; 01-12-2003 at 09:13 PM.

  • #5
    Regular Coder
    Join Date
    Nov 2002
    Posts
    567
    Thanks
    2
    Thanked 4 Times in 4 Posts
    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.
    Scott Stewart
    Always happy to learn from pros.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •