I have a Designer form in PDF format placed on my website. The PDF form has a text box that has a hyperlink in it. When the user clicks on the link, they are correctly sent to a new URL. However, if they close the new page, they disconnect from and close the form.
I had asked:
Is there any way to create the URL link in the text box so that it opens in a new window? That way, if the user closes the new window, the original PDF form is still open and visible.
Subsequently, I found this posting: http://forums.adobe.com/message/1335122
which suggests an answer. Using a script based on app.launchURL ("specific URL", true) seems to work.
Stefan's posting is accurate. You can launch a new browser window from a PDF using the Acroform app object. However, you cannot attach script to a Text field to access the app object since Text object instances are static and not exposed to the object model.
Alternatively, you can use a TextField, hide the caption, remove the border, add a default value representing the URL, and underline the default value to make it appear as a URL. You can then attach the app.launchURL method to the click event of the TextField.
A sample is attached.
Hi Waqas, Steve.
Thanks for your replies. I basically had done what you had suggested: created a text input box to allow naming, removed unnecessary items, gave the text URL an underline and created the script following the "app......." which sets the hyperlink.
The only thing that my text input box leaves (or at least I can't figure out how to remove this) is that the cursor naturally changes to the standard flashing text input line cursor when over the box. Any way to change the cursor style by scripting?
Otherwise, works fine. Thanks for your suggestions.