Skip to main content
Participant
September 18, 2018
Answered

Open web page from yes button in pop-up

  • September 18, 2018
  • 1 reply
  • 653 views

I have been trying to get this javascript to work. I need a pop up to come up and give a warning, then if yes is clicked, it will open a web page. If no is clicked, the window will close. I am going nuts trying to get the link to open the web page. Any help would be great!


var cMsg = "You will be linking to another website not owned or operated by First National Bank of Louisburg.  First National Bank of Louisburg is not responsible for the availability or content of this website and does not represent either the linked website or you, should you enter into a transaction. The inclusion of any hyperlink does not imply any endorsement, investigation, verification or monitoring by  First National Bank of Louisburg of any information in any hyperlinked site. We encourage you to review their privacy and security policies which may differ from  First National Bank of Louisburg.";
cMsg += "\n\nDo you want to continue?";

var nRtn = app.alert(cMsg,2,2,"Question Alert Box");
if(nRtn == 4)
{// A yes Response
  // app.launchURL("https://get.adobe.com/reader", true);
  console.println("The Response Was Yes");
}
else if(nRtn == 3)
{ // No Response
  console.println("The Response Was No");
}
else  
{ //Unknown Response
  console.println("The Response Was somthing other than Yes/No: " + nRtn);
}

    This topic has been closed for replies.
    Correct answer Bernd Alheit

    You have added // before app.launch...

    1 reply

    Bernd Alheit
    Community Expert
    Community Expert
    September 18, 2018

    What happens when you use the code?

    Participant
    September 18, 2018

    The pop up comes up when I click on the button on the form, if I click "no" the Window Closes", if I click "yes" the window also just closes and does nothing else. I would like it to open a web browser window and go to the specified link when "yes" is selected. Thanks!

    Bernd Alheit
    Community Expert
    Bernd AlheitCommunity ExpertCorrect answer
    Community Expert
    September 18, 2018

    You have added // before app.launch...