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 7 of 7
  1. #1
    Regular Coder harlequin2k5's Avatar
    Join Date
    Sep 2005
    Location
    Holiday, FL
    Posts
    635
    Thanks
    18
    Thanked 0 Times in 0 Posts

    pop up window check

    please bear with me - I have absolutely no experience with js at all

    here's the thing - the site I'm building requires an acknowledgment of some kind that a document has at least been looked at...considering that the original document is over 30 printed pages long it doesn't seem feasible to have someone scroll all the way to the bottom and then have a check box appear that they've read it

    so another idea was to have the user click the link for the document and if the pop-up window is able to open then the check mark will appear?

    either way I'm guessing it will require js

    please let me know if you need more information and as always - any help with this would be greatly appreciated

    ps - I guess while I'm at it - anyone have any suggestions for beginner js and/or ajax books?

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,010
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    May I ask what this document is? If it is some sort of terms and conditions, then it is not proper to ask the user to confirm that he has read it when he has not or may not have.

    Conversely, it is not wise for someone to confirm that they have read a particular document when they have not. I definitely would not do so.

    In principle all you need is a confirm box to pop up onbeforeunload.

    <script type = "text/javascript">
    function isOK() {
    var answer = confirm ("Have you at least looked at this document before leaving the page?\nClick on OK to confirm, or click on Cancel if you have not read the document.");
    if (answer) { //do something if OK clicked
    }
    else
    { // do something else if cancel clicked
    }
    </script>


    It is your responsibility to die() if necessary….. - PHP Manual
    Last edited by Philip M; 05-05-2008 at 06:25 PM.

  • #3
    Regular Coder harlequin2k5's Avatar
    Join Date
    Sep 2005
    Location
    Holiday, FL
    Posts
    635
    Thanks
    18
    Thanked 0 Times in 0 Posts
    thank you Philip M...

    I have already suggested the same thing about people clicking without actually having read what they're clicking for...

    it is not a privacy or terms & conditions document - it is a 504 Document which outlines a capital investment - the document is also available for downloading in pdf format and if the user was to invest, they would receive a printed copy along with their stock certificate

    I will attempt your suggestion - lol I'm so clueless about js

  • #4
    Regular Coder harlequin2k5's Avatar
    Join Date
    Sep 2005
    Location
    Holiday, FL
    Posts
    635
    Thanks
    18
    Thanked 0 Times in 0 Posts
    ok I've been struggling with this and I've even tried to apply other examples and I'm not understanding what I need to do

    based on the example that Philip M. provided I've tried using:
    Code:
    <script type="text/javascript">
    function isOK (
      {
        var answer = confirm ("By clicking on "Continue" you are aknowledging that you have read and accept the terms of the Confidential Private Placement Offering Memorandum for The Martial Arts Group, Inc.");
    if (answer) { 
        document.write("You are now being redirected to the Subscription Agreement.") 
    }
    else
    { 
        document.write("You should go back and read or download the document for further review.")
    }
    </script>
    
    <input type="button" name="continue" value="Continue" onClick="isOK();" />
    but when you click on the button nothing happens

  • #5
    Regular Coder harlequin2k5's Avatar
    Join Date
    Sep 2005
    Location
    Holiday, FL
    Posts
    635
    Thanks
    18
    Thanked 0 Times in 0 Posts
    no suggestions?

  • #6
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,010
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Code:
    <script type="text/javascript">
    function isOK()  {
        var answer = confirm ("By clicking on  'Continue' you are acknowledging that you have read and accept the terms of the Confidential Private Placement Offering Memorandum for The Martial Arts Group, Inc.");
    if (answer) { 
        document.write("You are now being redirected to the Subscription Agreement.") 
    }
    else  { 
        document.write("You should go back and read or download the document for further review.")
    }
    }
    </script>
    
    <input type="button" name="continue" value="Continue" onClick="isOK();" />
    Instead of document.write I would suggest either an alert or display the message in a <span> using innerHTML.


    I know Karate! And five other Japanese words.
    Last edited by Philip M; 05-09-2008 at 06:34 PM.

  • #7
    Regular Coder harlequin2k5's Avatar
    Join Date
    Sep 2005
    Location
    Holiday, FL
    Posts
    635
    Thanks
    18
    Thanked 0 Times in 0 Posts
    I'm going to have to find another way to do this - I'm just not following what it is I need to do


  •  

    Posting Permissions

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