Expand my Community achievements bar.

Open URL in new Window

Avatar

Former Community Member
My form is used from within an Internet Explorer window. Can someone help me to be able to click on a button in my form and open a new session of IE to a new URL? Below is what I am doing now, but it is not working.



Thanks,

Velvet



I have a button in my pdf and have added the following to the click event.

sObj.popitup("http://www.adobe.com");



I have a script object names sObj that contains my functions. Below is the function.



function popitup(url)

{

xfa.host.messageBox("started popitup" );

newwindow=xfa.host.window.open(url,'name','height=200,width=150');

if (window.focus) {newwindow.focus()}

return false;

}



I know that I am getting to the function because the message box pops up. But nothing else happens.
3 Replies

Avatar

Former Community Member
There is no object called window in xfa.host so the script will fail when it reaches that point. You will see the first message box and nothing else.



If you are using PDF in the browser then you can use

app.launchURL(cURL, bNewFrame);



The second parameter allows you to open the URL in a new window.



If you are using HTML via LiveCycle Forms, then you can still use window.open()

Avatar

Former Community Member
Below is the code I added to the click event of the my button in the PDF, but it is not yet working. Can you see what I did wrong?



app.launchURL("http://www.adobe.com", bNewFrame);



I also tried



app.launchURL(c"http://www.adobe.com", bNewFrame);

Avatar

Former Community Member
I found what I did wrong, the code below works.



Thank you for your help!!



app.launchURL("http://www.adobe.com", true);