$Web Parm: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Value of isindex or form field<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Value of isindex or form field<section end="desc" /></span>


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


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


==Syntax==
==Syntax==
Line 13: Line 13:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>fieldname</th>
<tr><th>fieldname</th>
<td>The name of the isindex or form field, returned by $Web_Name. Required argument if occurrence not specified, otherwise optional.</td></tr>
<td>The name of the isindex or form field, returned by <var>[[$Web_Name]]</var>. Required argument if occurrence not specified, otherwise optional.</td></tr>
<tr><th>occurrence</th>
<tr><th>occurrence</th>
<td>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.</td></tr>
<td>The occurrence number of an isindex or form field, or the occurrence number of the isindex or form field matching <var class="term">fieldname</var>, if <var class="term">fieldname</var> is specified. Optional argument if <var class="term">fieldname</var> is specified, otherwise it is required.</td></tr>
<tr><th>start</th>
<tr><th>start</th>
<td>Starting position within the field. Optional argument which defaults to 1.</td></tr>
<td>Starting position within the field. Optional argument which defaults to 1.</td></tr>
<tr><th>length</th>
<tr><th>length</th>
<td>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.
<td>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 <var>[[$Web_Len]]</var>. The default is the length of the isindex or form field.
</td></tr></table>
</td></tr></table>


==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 <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.  
<li><var>$Web_Parm</var> first looks for isindex fields matching the name, then for matching form fields. <var>$Web_Parm</var> can 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>


==Examples==
==Examples==
This example places the value of each isindex or form field in a URL into a User Language %variable of the same name.
This example places the value of each isindex or form field in a URL into a <var class="product">User Language</var> %variable of the same name.
<p class="code">&#42; Stash the form values in matching fields.
<p class="code">&#42; Stash the form values in matching fields.
   
   

Revision as of 15:24, 15 June 2012

<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.

$Web_Parm takes 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 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.

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