<parameters>

New to Version 2.0: This marks the beginning of the parameters section. In this section of the form, you define which parameters you will be receiving, what name you'd like to associate with them, and any default value you'd like to use if the parameter is missing. Within the form, <parameters> exists at the same level in the form hierarchy as <controls> and <variables>. Parameters are most often sent via the URL as a query string parameter. However, they can also be POST'ed to the form.

 

<parameters> has no attributes, but it has one type of child tag: <parameter> which does have attributes.

 

USAGE:

By themselves, parameters aren't of much value. However, they become powerful when you use them in your form. You can assign the value of a parameter as the default value of a text box, for instance. Or you can assign it as the value of a <hidden> field to save it with the data the user enters in the form or to pass it through via HTTP POST to another program.

 

To use parameter values, you put placeholders in your form code where you want the parameter's value to go. Placeholders look like this: {MyParameter}  where the name the parameter is enclosed in brackets. That's all there is to it. At run-time, XMod will replace those placeholders with the parameter's value (or the default value if no parameter was found). Note that parameter aliases must be unique within the form among all parameters, variables, and form controls.

 

ATTRIBUTES <parameter>:

name

This is the name of the parameter that XMod should be looking for. This is the name of the parameter that will be passed to the XMod form. (Required)

alias

To conserve space, parameters are typically shortened to as little as one letter. This makes it harder to work with and the name may conflict with another variable, parameter, or control name in the form. Thus you can specify a different name for the parameter here. This attribute is required, so if you don't need to alias the parameter name, simply duplicate the value from the name attribute. Note that parameter aliases must be unique within the form among all parameters, variables, and form controls.

default

If XMod is unable to find or retrieve the named parameter, it will substitute the value it finds in this attribute for the parameter name.

source

Optional. If the value of this attribute is "session" then XMod will look for the parameter in the list of session variables. If not specified, XMod will look for the parameter in the list of parameters sent with the request.
New to Version 3.0

EXAMPLES:

In the example below, you can see how to define your parameters for XMod and how to use them. The relevant areas are marked in red.

 

<form format="custom">

  <parameters>

    <parameter name="uid" alias="UserId" default="-1"></parameter>

    <parameter name="bookname" alias="BookTitle" default=""></parameter>

    <parameter name="redir" alias="RedirectUrl" default="/Default.aspx?tabid={XMOD_HomeTabId}"></parameter>

  </parameters>

  <controls>

    <literal>

      <!--Everything in here is HTML -->

      <table style="border: 1px blue solid; width=400px;">

<tr>

  <td><h2>Welcome To My Custom Form</h2></td>

</tr>

      </table>

      <table width="400" cellpadding="3">

        <tr>

          <td style="background-color:maroon; color:white;">

            Your Name:</td>

          <td>

    </literal>

            <input ref="Title" width="250px" class="NormalTextBox">

              <label>Title</label>

              <default>{BookTitle}</default>

            </input>

    <literal>

          </td>

        </tr>

      </table>

    </literal>

    <hidden ref="CustomerId">{UserId}</hidden>

    <redirect target="{RedirectUrl}" nosave="true" />

  </controls>

</form>