An XMod "processing instruction" that tells XMod to send the user to the specified target after form submission. This is useful if you'd like to perform additional processing, thank the user for their input, show the user additional data. Since the user can only be directed to one destination, only one <redirect> tag is recognized per form. If more than one are on a form, the last <redirect> tag is the one that takes precedence.
Because of .NET's architecture, HTTP POSTing necessitates using an interim page that uses Javascript to initiate the post. If the user doesn't have Javascript enabled, they are presented with a "Continue" button to click to finish the process.
NOTE: If the URL you specify as the target contains ampersands (&), you should substitute the & entity for them. As of version 1.2, the application now replaces any "&" characters with "&" before submitting the URL for redirection.
NOTE: If you choose to POST or GET form results, form field values are passed as parameters to the target. The name of the parameters is the name of the form control (the value of the control's "ref" attribute). So, a form that contains a control for the entry of a user's name like :
<form>
<controls>
<input ref="FirstName">
<label>Your First Name: </label>
</input>
<input ref="LastName">
<label>Your Last Name: </label>
</input>
<select ref="FavoriteFlavors">
<label>Your Favorite Ice Cream Flavors</label>
<items>
<item>
<label>Vanilla</label>
<value>v</value>
</item>
<item>
<label>Chocolate</label>
<value>c</value>
</item>
<item>
<label>Strawberry</label>
<value>s</value>
</item>
</items>
</select>
<select ref="ViewType" appearance="minimal">
<items>
<item>
<label>Minimal</label>
<value>1</value>
</item>
<item>
<label>Normal</label>
<value>2</value>
</item>
<item>
<label>Maximum Verbosity</label>
<value>3</value>
</item>
</items>
</select>
</controls>
</form>
If the user enters "John" and "Doe" for the name fields and selects "Vanilla" and "Strawberry" for the ice cream flavors, the parameters passed would be like: FirstName=John LastName=Doe FavoriteFlavors=v FavoriteFlavors1=s
For list controls that allow more than one selection, the parameter will contain a comma-separated list of selected values. For controls such as the RadioButton list and CheckBox list, each selected item is a separate parameter with its name built from the control's name. The first selected item will be passed as controlname, the second selected item will be passed controlname1, the third selected item will be passed as controlname2. Also, since controls are being passed as HTML controls, the CheckBox list controls will only pass "on" as the value for selected items.
New to Version 2.0: You can now use control value placeholders to help build the redirect URL. So, you could create a URL with a tag like this:
<redirect target="/Default.aspx?tabid=123&view={ViewType}" />
target |
Valid URL to which you want to send user after form submission |
nosave |
If this attribute is true then XMod will not save the contents of the form to the database. This is most often used when you are using the "Feedback" component of XMod, which allows you to display forms directly to users, without them having to have Edit permissions. If this attribute is not specified or the value is false then the data from the form will be saved to the database. Valid values are true and false (Optional) |
method |
If the value of this parameter is post then the data from the form will be HTTP POSTed to the URL specified in target. If the value of this attribute is get then the form's data will be sent to the specified URL via HTTP GET. If the attribute isn't specified, then no data will be sent and the user will simply be redirected to the URL specified by target. Valid values are post and get (Optional) |
<redirect target="http://knowbetter.com" method="post" nosave="true" />