dialog box to show rest of an htm page

H

Hal Halloway

Newbie looking for the way have a dialog box and when a user goes to
this page they see *nothing*, Except for a dialog box pop, the box says:
"are you sure?" Yes/No. If user clicks yes they see the rest of the page
- (just some simple html). Else no, they might see a message that says
"go back".

I need the simplest briefest example - Thanks
 
J

Joakim Braun

Hal Halloway said:
Newbie looking for the way have a dialog box and when a user goes to
this page they see *nothing*, Except for a dialog box pop, the box says:
"are you sure?" Yes/No. If user clicks yes they see the rest of the page
- (just some simple html). Else no, they might see a message that says
"go back".

I need the simplest briefest example - Thanks

Perhaps it would be user-friendlier to put the confirm() dialog in the
originating page? If user confirms, he goes to the new page. If user doesn't
confirm, he stays put:

<a href="yourPageHere.htm" onclick="return confirm('Are you sure?');">Go
somewhere</a>

Or you could have an "intermediate" page that shows the confirm() dialog and
forwards to the real page. The <body> might look something like this:

<script type="text/javascript">

if(confirm("Are you sure?")){
document.location.href = "yourPageHere.htm";
}
else if(document.referrer != ""){
document.write("<a href=\"" + document.referrer + "\">Back</a>");
}
</script>

document.referrer is supposed to be available when a page was reached by
clicking a link. (The text of the confirm() dialog buttons can't be changed
and may be a localized version of "OK" and "Cancel".)
 
H

Hal Halloway

Joakim said:
Perhaps it would be user-friendlier to put the confirm() dialog in the
originating page? If user confirms, he goes to the new page. If user doesn't
confirm, he stays put:

<a href="yourPageHere.htm" onclick="return confirm('Are you sure?');">Go
somewhere</a>

Thank you!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top