$Web_Parm

From m204wiki
Revision as of 21:33, 21 February 2011 by 198.242.244.47 (talk) (Created page with "{{DISPLAYTITLE:$Web_Parm}} <span class="pageSubtitle"><section begin="desc" />Value of isindex or form field<section end="desc" /></span> $Web_Parm retrieves the value of an i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<section begin="desc" />Value of isindex or form field<section end="desc" />


$Web_Parm retrieves the value of an isindex or form field in a request.

Syntax

<section begin="syntax" /> %STRING = $Web_Parm( fieldname, occurrence, start, length ) <section end="syntax" />


$Web_Parm takes four arguments and returns a string, or null for any error condition.

fieldname The name of the isindex or form field, returned by $Web_Name. Required argument if occurrence not specified, otherwise optional.
occurrence The occurrence number of an isindex or form field, or the occurrence number of the isindex or form field matching 'fieldname', if fieldname is specified. Optional argument if fieldname is specified, otherwise it is required.
start Starting position within the field. Optional argument which defaults to 1.
length Length to return. This is an optional argument, provided in case an isindex or form field exceeds 255 bytes. The length of an isindex or form field can be determined with $Web_Len. The default is the length of the isindex or form field.


This example places the value of each isindex or form field in a URL into a User Language %variable of the same name.

* Stash the form values in matching fields. %CUSTOMER_NAME = $Web_Parm( 'CUSTOMER_NAME' ) %CUSTOMER_NUM = $Web_Parm( 'CUSTOMER_NUM' ) %ORDER_NUM = $Web_Parm( 'ORDER_NUM' ) %ORDER_DATE = $Web_Parm( 'ORDER_DATE' ) %ORDER_ITEM = $Web_Parm( 'ORDER_ITEM') %ORDER_ITEM2 = $Web_Parm( 'ORDER_ITEM', 2)


$Web_Parm first looks for isindex fields matching the name, then for matching form fields. $Web_Parm can be used instead of $Web_IsIndex_Parm and $Web_Form_Parm to make it easy to switch between using "method=GET" and "method=POST"<form> tags and simply to save typing.

See also: