Description
The
<form> and
<formItem> element allows you to place forms onto your WAPL pages. This allows you to put search boxes, login forms and anything else you would normally do in a form onto a mobile device.
Quick Example
..snip..- <row>
- <cell>
<form>
<action>http://my-domain/location.htm</action>
<formItem item_type="text">
<name>s</name>
</formItem>
<formItem item_type="submit">
<name>Search</name>
</formItem>
</form>
- </cell>
- </row>
..snip..
Child Elements
action
This is to be used for forms created using WAPL Web Services. This element defines the destination script to post the form data to. The script should handle _POST and pass the generated WAPL via another SOAP call. The correct markup for the device will then be returned and should be output to the browser.
If you are using a WAPL chunk in Wapple Canvas, see 'url'.
Example:
<form>
<action>http://your-domain.com/search.htm</action>
</form>
url
If you are using a WAPL chunk within a Wapple Canvas site, this element should be used instead of 'action'. Upon form submission, the form data will be posted to the destination script. This script should handle _POST and output the relevant WAPL. The WAPL chunk will handle the rendering of the WAPL.
Example:
<form>
<url>http://your-domain.com/search/</url>
</form>
formItem
You can place multiple
<formItem> elements into your form in order to generate a functioning form. For more information, please see the section on
form items.
Example:
<form>
<formItem item_type="text">
<name>searchTerm<name>
<value><value>
</formItem>
<formItem item_type="submit">
<name>Search<name>
</formItem>
</form>
Detailed Example
..snip..- <row>
- <cell>
<form>
<action>http://my-domain/location.htm</action>
<formItem item_type="hidden">
<name>hidden_field</name>
<value>xyz</value>
</formItem>
<formItem item_type="select">
<name>select_field</name>
<possibility>
<label>Option 1</label>
<value>1</value>
</possibility>
<possibility>
<label>Option 2</label>
<value>2</value>
</possibility>
</formItem>
<formItem item_type="text">
<name>ID</name>
<value></value>
<input_mask>*N</input_mask>
<maxlength>2</maxlength>
</formItem>
<formItem item_type="file">
<label>Upload a file</label>
<name>FILE</name>
</formItem>
<formItem item_type="checkbox">
<name>check</name>
<value>1</value>
</formItem>
<formItem item_type="textarea">
<name>text</name>
<value>Please enter your text...</value>
</formItem>
<formItem item_type="password">
<name>pass</name>
- <value></value>
- </formItem>
..snip..