By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,712 Members | 1,381 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,712 IT Pros & Developers. It's quick & easy.

dialog box to show rest of an htm page

P: n/a
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
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Hal Halloway" <Ha******@nospam.net> skrev i meddelandet
news:0o4Ld.2767$zb.2094@trnddc07...
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".)

--
Joakim Braun
Jul 23 '05 #2

P: n/a
Joakim Braun wrote:
"Hal Halloway" <Ha******@nospam.net> skrev i meddelandet
news:0o4Ld.2767$zb.2094@trnddc07...
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>


Thank you!!!!

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".)

--
Joakim Braun

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.