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 )
$id = this.getField('ID').value;
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!
Thanks a lot
First of all , don't put a dollar sign before your variable's name. It's not necessary in JS.
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);