I am trying to have a message box appear before the form loads with a disclaimer and YES/NO buttons. If the users clicks YES, I would like a web page to open with a particular URL, if they click NO then the form will just load. Here is the code I have so far. The messageBox opens fine, but if they click YES, the URL does not open. The form just opens like normal. Any ideas on what I am doing wrong?
form1::ready:layout - (JavaScript, client)
var message;
if (xfa.host.name != "XFAPresentationAgent")
{
message = "Disclaimer";
message += "\n\n";
message += "For your convenience, this form has been made available in an electronic format. The form can be completed and submitted via e-mail using a computer and an electronic signature.";
message += "\n\n";
message += "If you prefer, you can print the form, complete it, and send it to us by US Mail. We prefer to receive this document in an electronic form via e-mail, however, no fees or penalties will be charged to you for sending in a paper form.";
message += "\n\n";
message += "This form must be completed for each producer you choose to list. To complete the form electronically you will need Adobe Acrobat Reader.";
message += "\n\n";
message += "Do you want to install or update Adobe Acrobat Reader now?"
xfa.host.messageBox(message, "Adobe Acrobat Reader Required", 3, 2);
}
var button = xfa.host.response(message, "Adobe Acrobat Reader Required", 3, 2);
if (button == 4)
{
xfa.host.gotoURL("http://www.adobe.com/go/acrobat");
}
I corrected your script a some way.
So I replaced the function "response" with "messageBox", because you don't need it this scenario.
radzmar
• LoveCycle Blog
Documents you need:
• LiveCycle Designer ES2 Docs