Expand my Community achievements bar.

SOLVED

How to add a target to Hyperlink?

Avatar

Level 1

Hi,

Is it possible to add a hyperlink that opens the url on a new page.

I triede several xmlcodes, but it doesn't work

Is it also possible to add a hyperlink to a image?

example:

<

value>

               <

exData contentType="text/html">

                  <

body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:APIVersion="2.7.0.0"><p style="text-decoration:none;letter-spacing:0in"><a href="http://bouwhandel.most.nl/content/files/Images/Handelsonderneming/Prijsaanvraag/plankenschermen/0810..."><span style="font-family:'Myriad Pro';font-size:8pt;font-weight:bold">zoom in</span></a></p></body>

               </

exData>

            </

value>

            <

caption placement="bottom" reserve="3.5062mm">

               <

font typeface="Myriad Pro" size="8pt" baselineShift="0pt" weight="bold">

                  <

fill>

                     <

color value="0,0,128"/>

                  </

fill>

               </

font>

               <

para vAlign="middle" hAlign="center" spaceAbove="0pt" spaceBelow="0pt" textIndent="0pt" marginLeft="0pt" marginRight="0pt"/>

            </

caption>

            <

para hAlign="center"/>

            <

traversal>

               <

traverse ref="Image4[0]"/>

            </

traversal>

         </

draw>

         <

draw name="Rechthoek2" y="73.025mm" x="92.075mm" w="19.05mm" h="0.258222in">

            <

ui>

               <

textEdit/>

            </

ui>

1 Accepted Solution

Avatar

Correct answer by
Level 7

I think this is a bug in your form, everything after the "//" in the web address is commented out. This of course is the symbol for commenting out script, but I've never seen it affect the app.launchURL function before. I also tried creating a new button but it has the same behavior. I would advise you to put in a support ticket with Adobe.

Edit: My mistake, I forgot the quotes when I gave you the script initially. Here's the correct script:

app.launchURL("http://www.bouwhandel.most.nl/content/files/Images/Handelsonderneming/Prijsaanvraag/sierhekken/1_4.jpg"

, true);

View solution in original post

13 Replies

Avatar

Level 7

You can open a link to a url with a button click using this script:

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

It's not possible to add a link to an image however. Static images are not clickable and clickable images will open an upload window. You can, however, overlay an image with a transparent button to give the illusion of a hyperlinked image. See this post:

http://forums.adobe.com/message/1355920#1355920

Avatar

Level 1

Can I add  someting like TARGET='_blank' to the hyperlink??

Avatar

Level 7

If I'm not mistaken it will open in a new tab anyway, there's no need to set the target.

Avatar

Level 7

You should also be aware that you can't open another application using this method, for example word or excel. You can open web pages and other forms, but not applications.

Avatar

Level 1

It is just for opening image

This is my code right now

formulier1.#subform[0].Button1::mouseDown - (FormCalc, client)


app.launchURL(http:

//bouwhandel.most.nl/content/files/Images/Handelsonderneming/Prijsaanvraag/sierhekken/1_4.jpg, true);


It gives a syntax error near token ':'

Avatar

Level 7

You're missing the "www" after the "//".

Avatar

Level 1

Scripted failed (language is formcalc; context is

xfa[0].form[0].formulier1[0].#subform[0])

script=app.launchURL(http://www.bouwhandel.most.nl/content/files/images/handelsonderneming/prijsaanvraag/sierhekken/1.4.j.... true);

Error: syntax error near token ':' on line 1, column 19

Avatar

Level 7

Change the language to javascript. You also have a period after jpg, there should only be a comma. Your script should be this:

app.launchURL(http://www.bouwhandel.most.nl/content/files/images/handelsonderneming/prijsaanvr aag/sierhekken/1.4.jpg, true);

with javascript selected as the scripting language.

Avatar

Level 1

Im sorry that still bother you, but the syntax error is gone, but the button does nothing:

this is the document:

http://bouwhandel.most.nl/content/files/Files/Formulier_sierhekken_706_new.pdf

The first image has the zoom in button above it

Avatar

Correct answer by
Level 7

I think this is a bug in your form, everything after the "//" in the web address is commented out. This of course is the symbol for commenting out script, but I've never seen it affect the app.launchURL function before. I also tried creating a new button but it has the same behavior. I would advise you to put in a support ticket with Adobe.

Edit: My mistake, I forgot the quotes when I gave you the script initially. Here's the correct script:

app.launchURL("http://www.bouwhandel.most.nl/content/files/Images/Handelsonderneming/Prijsaanvraag/sierhekken/1_4.jpg"

, true);

Avatar

Former Community Member

If you change the last parameter to false it will work....so you know there is nothing wrong with your code (assuming you put quotes around the URL as djaknow suggested). It looks like the ability to spawn a new browser session has changed in the latest release where Acrobat is not allowing that anymore (for security reasons) unless you certify the doc.

paul

Avatar

Level 10

I think the problem is in the URL itself.. The folder names are case sensitive and in the URL you have used small case where upper case is expected..

You are using: http://www.bouwhandel.most.nl/content/files/images/handelsonderneming/prijsaanvrhttp://www.bouwhandel.most.nl/content/files/images/handelsonderneming/prijsaanvrhttp://www.bouwhandel.most.nl/content/files/images/handelsonderneming/prijsaanvrhttp://www.bouwhandel.most.nl/content/files/images/handelsonderneming/prijsaanvraag/sierhekken/1.4.j...aag/sierhekken/1.4.jpg

Where as the webserver where the images are stored is looking for a upper case "H" in "Handelsonderneming" and upper case "P" in "Prijsaanvraag"..

And placing the code in double quotes..

app.launchURL("http://bouwhandel.most.nl/content/files/Images/Handelsonderneming/Prijsaanvraag/sierhekken/1_4.jpg", true);

Thanks

Srini

Avatar

Level 1

It did the trick!!!

and parameter must be set on 'true' is good

thanks to you all