Getting form fields

Hi everybody,

I’m not able to work out this problem:

I have a HTML form like

My name
<input  type="text" name="myname"/> <br/><br/>
My address <input  type="text" name="myaddress"/>

<br><br>
<input type="submit" value="Invia"/>
</form>

In the sequence esercizioPayload.xml I would like to get the values of
“myname” and “myaddress” fields.
Note that I use enctype=“application/x-www-form-urlencoded”;

How can I do to get them? What kind of Mediator components do I have to use?

Thanks

Raffaele Apisa

Hi Raffaele,

The values you are setting in your form are available in the XML Mediator in the form of message properties. You can access message properties using Xpath statements in nearly every component or sequence processing step.

XPath expressions to evaluate the values of the properties you set in your form would look like:

{‘$myname’} and {‘$myaddress’}.

Hope that helps.

Hi Raffaele,

You also need to specify method=“get” instead of “post” to get the form fields added as query parameters to the incoming URL. The query parameters will become Mediator properties.

Hope this helps.

Hi Matthew, Hi Mike,

now I can get the parameters as described by Matthew.

Thanks so much

Raffaele A.