...

View Full Version : pop up window check



harlequin2k5
05-05-2008, 03:47 PM
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?

Philip M
05-05-2008, 06:16 PM
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

harlequin2k5
05-05-2008, 07:11 PM
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 :)

harlequin2k5
05-08-2008, 09:37 PM
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:

<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

harlequin2k5
05-09-2008, 05:48 PM
no suggestions?

Philip M
05-09-2008, 06:27 PM
<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.

harlequin2k5
05-09-2008, 07:19 PM
I'm going to have to find another way to do this - I'm just not following what it is I need to do



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum