#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    229
    Rep Power
    13

    2 javascript functions on 1 click?


    I have a popup window that is a disclaimer with an AGREE and DISAGREE button. If the person selects DISAGREE, it just closes. But if they select AGREE, it opens a new window with a pdf file. What I WANT IT TO DO is to not only open up that new file but also close the popup at the same time. I already tried putting the window.close function in the same href as the link to the new file but that didn't work.... How can I do this?

    Here's the code for the buttons:

    <tr>
    <td align="center" valign="top"><a href="pdf/select_prospectus.pdf;" target="_blank"><img src="agreebutton.gif" width="91" height="34" border="0" alt="Agree"></a>
    </td>
    <td a href="javascript:window.close();"><img src="disagreebutton.gif" width="91" height="34" border="0" alt="Disagree"></a>
    </td>
    </tr>
  2. #2
  3. An Ominous Coward
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2002
    Posts
    4,425
    Rep Power
    0
    Nothing fancy:

    PHP Code:
    <a href "javascript:window.open('URL_TO_OPEN'); window.close();">Open a new windowclose the current one</a
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    229
    Rep Power
    13

    thank you!


    that works perfectly - thank you SO much!

IMN logo majestic logo threadwatch logo seochat tools logo