Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confirm box before redirect

Status
Not open for further replies.

emozley

Technical User
Jan 14, 2003
769
GB
Hi,

I have a mail script and I want a javascript box to pop up saying "An email has been sent you should get it in 5 to 10 minutes" and then do a redirect.

Unfortunately it redirects without displaying the alert box.

<script>
alert("An email has been sent to you and should be with you in the next five or ten minutes")
</script>

<%
URL="../index.asp?TheMonth=" & TheMonth & "&TheYear=" & TheYear & "&CategoryCode=" & CategoryCode
Response.Redirect(URL)
%>

I thought about some kind of confirm box but I only want it to have an OK button not Cancel.

Is this possible or am I better of redirecting to a confirmation screen done in plain HTML with a link on that goes back to ../index.asp?

Thanks very much

Ed
 
Redirects are done on the server without sending anything to the client computer, so nothing will display on the client because nothing is sent.

You could use your Javascript alert() on the page, then use either change the URL with Javascript's location.href or using a META REFRESH tag if you want to display something for the end user.

Lee
 
I would use a confirmation screen as the javascript alert won`t work if they have javascript turned off.
 
Yup. I read recently somewhere on Tek-Tips that only about 4% of the browsers have Javascript disabled. The META REFRESH would work to redirect after displaying your confirmation message on the screen for however many seconds you choose.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top