$Web Parm: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 24: Line 24:
==Usage notes==
==Usage notes==
<ul>
<ul>
<li><var>$Web_Parm</vartfirst looks for isindex fields matching the name, then for matching form fields. <var>$Web_Parm</vartcan be used instead of $Web_IsIndex_Parm and <var>$Web_Form_Parm</var> to make it easy to switch between using "method=GET" and "method=POST"<form> tags and simply to save typing.  
<li><var>$Web_Parm</vartfirst looks for isindex fields matching the name, then for matching form fields. <var>$Web_Parm</vartcan be used instead of <var>$Web_IsIndex_Parm</var> and <var>$Web_Form_Parm</var> to make it easy to switch between using "method=GET" and "method=POST"<form> tags and simply to save typing.  
</ul>
</ul>



Revision as of 15:17, 15 June 2012

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

$Web_Parm</vartretrieves the value of an isindex or form field in a request.

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

Syntax

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

Syntax terms

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.

Usage notes

  • $Web_Parm</vartfirst looks for isindex fields matching the name, then for matching form fields. $Web_Parm</vartcan 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.

Examples

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)

See also