p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   Javascript How-To (http://p2p.wrox.com/javascript-how-87/)
-   -   change this alert/confirm box (http://p2p.wrox.com/javascript-how/26621-change-alert-confirm-box.html)

crmpicco March 9th, 2005 12:19 PM

change this alert/confirm box
 
I have a else statement in my <script> block:

else
{
    // Acrobat is NOT installed. Do something else.
    document.write("Acrobat is NOT installed.")
    alert ("You do not have Adobe Acrobat Installed. Click OK to download this software")
}

does anyone have code so i could change this alert/confirm box so that if a 'OK' button on the box is clicked then go to a page on the Adobe site. else if a 'continue' button is clicked then submit the form on the page.



www.crmpicco.co.uk
www.milklemonadechocolate.uk.tt

joefawcett March 9th, 2005 12:48 PM

You need the confirm button, which always shows 'OK' or 'Cancel':
Code:

if (confirm("Choose 'OK' to download Acrobat Reader now, choose 'Cancel' to continue."))
{
  window.location = <url for reader download>;
}
else
{
 //continue ...
}

--

Joe (Microsoft MVP - XML)

crmpicco March 9th, 2005 01:09 PM

hey joe,
i have a new problem
when the 'File Download - Security Warning' dialogue box appears when cancel button is clicked i want to redirect to the previous page:

Code:

question = confirm("You do not have Adobe Acrobat Reader Installed on your system. \n\nClick OK to download this software now. Click Cancel to go Back")
    if (question !="0"){
        top.location = 'http://ardownload.adobe.com/pub/adobe/reader/win/7x/7.0/enu/AdbeRdr70_enu_full.exe'
    }
    if (question =="0"){
        history.back()
    }

www.crmpicco.co.uk
www.milklemonadechocolate.uk.tt

crmpicco March 9th, 2005 01:11 PM

this is after the 'OK' has been hit

www.crmpicco.co.uk
www.milklemonadechocolate.uk.tt


All times are GMT -4. The time now is 02:17 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.