Expand my Community achievements bar.

SOLVED

Dynamic submit to url in submit button

Avatar

Level 2

Hi,

Let's say there are 3 different environments (e.g. DEV-TEST-PRODUCTION).

Each environment has a designated url for PDF form submission.

What I'd like to know is if there's a way to dynamically set the submit to url depending on where the PDF reside?

E.g., I'd like to be able to create a PDF in Dev and promote it to Test environment without touching the submit to url manually to the environment's url.

Thanks in adavnce.

1 Accepted Solution

Avatar

Correct answer by
Level 8

If you add some additional complexity you should be able to do this with a combination of a Servlet and LiveCycle Forms.

Here's my idea:

- modify your web page where you normally put the form to call a servlet rather than just have a link to a form (using an HTTP Get will look the same to the user).

- when the servlet is called calculate the current server's location using the servlet's built in context root.  Build a target URL based on that location

- add that target url to a LiveCycle URLSpec type variable usig the setTargetURL parameter

- call LC Forms to render the form

- send the returned form to the browser

LC Forms will set the target url in the submit button so it goes to the place you specified using the setTargetURL parameter

View solution in original post

2 Replies

Avatar

Correct answer by
Level 8

If you add some additional complexity you should be able to do this with a combination of a Servlet and LiveCycle Forms.

Here's my idea:

- modify your web page where you normally put the form to call a servlet rather than just have a link to a form (using an HTTP Get will look the same to the user).

- when the servlet is called calculate the current server's location using the servlet's built in context root.  Build a target URL based on that location

- add that target url to a LiveCycle URLSpec type variable usig the setTargetURL parameter

- call LC Forms to render the form

- send the returned form to the browser

LC Forms will set the target url in the submit button so it goes to the place you specified using the setTargetURL parameter

Avatar

Level 2

Thanks Hodmi,

Your suggestion solved the problem.