1 Reply Latest reply on Jun 16, 2009 5:40 AM by try67

    Using form value for dynamic link




      my PDF contains an text input field and a button.


      The value which is entered into the field should be included into a weblink which should be opened in a browser on clicking the button. (e.g. http://www.xxx.yy/theID )


      1) My input field has an ID, and I can get this ID running the following Javascript:


      $id = this.getField('ID').value;


      So I added a first action "Run a Javascript" to this Button, containing this code.


      2) Next step would be to add a second action "Open a web link" to the button, setting the URL e.g. http://www.xxx.yy


      The question is: how can I combine these two actions and put the value of $id into the link of my "open a web link" method to dynamically change the URL to http://www.xxx.yy/theID ?


      For example: I entered 12345 into the field, then on pressing the button http://www.xxx.yy/12345 should be opend!


      Any ideas?


      Thanks a lot

        • 1. Re: Using form value for dynamic link
          try67 MVP & Adobe Community Professional

          First of all , don't put a dollar sign before your variable's name. It's not necessary in JS.

          As for your question: I don't think it can be done using the "Open a web link" action, but it can be done using the "Execute JavaScript" action.

          In it you can use the launchURL method, to which you can specify a URL string. In this string you can include the value of your text field, like so:


          app.launchURL("http://www.xxx.yy/" + this.getField("ID").value);