Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Form Submit - setting submit URL

Avatar

Former Community Member

Hello...

We have several forms which will be submitting thier XML to a servlet which will in turn invoke various orchestrations to process the data.  The servlet URLs are different per environment.  What is the easiest way to adjust the submit URL on a submit button in this case?

I realize I could pass in a parameter representing this variable, but I dont see how to set that as the URL for the submit button within the form. 

I would prefer not to have to pass in the URL each time a form is rendered.  Is there a way to do this with some sort of global variable of some kind?

Thanks,

jigster

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

yes that is where you woudl set it. The submit URL will go into a hidden field and there is script on the form that will adjust the Submit button on the form to change its submit url to that value.

Paul

View solution in original post

5 Replies

Avatar

Former Community Member

You can programmatically set the URL of the submit button. How does the form know which servlet URL to call? Is there something on the form which tells it which URL to use?

Paul

Avatar

Former Community Member

Thats the issue... whats the best way to maintain that URL which will be changing envornment?  We would like to be able to migrate the forms as they are to the various environments, but we need to update that submit URL as part of that.  The various orchestrations that render the form could add values to the input xml to give the form the correct submit URL, which would work, but if the URL has to change or be adjusted on a per form basis, that doesnt work so well.

I would like to aviod having to pass in the URL as a parameter to every orchestration that reders a form if possible...  how is this best handled?  It seems like a pretty harsh limitation at this point...

(BTW - I havent been able to programmatically set the button URL... I have tried usehref which causes my IE and Acrobat 9 instances to crash...  Hard)

Avatar

Former Community Member

I am confused .....we have to have a Submit URL in the form but you do not want to pass it in as a parameter. Then how are we goingto get that URL? Once I have it in the form I can show you how to set it.

Paul

Avatar

Former Community Member

I guess I was hoping there was a way to use some sort of config parameter like whats available for the orchestrations... where the parameter value comes from the server.

Ok, so lets assume we will pass in the parameter...  For setting the submit URL, is that where you have to pass the url in the tartgetURL parameter for the renderForm?

I have tried scripting to set the actual button usehref but that doesnt work...

Avatar

Correct answer by
Former Community Member

yes that is where you woudl set it. The submit URL will go into a hidden field and there is script on the form that will adjust the Submit button on the form to change its submit url to that value.

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----