$Web Form Parm: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{DISPLAYTITLE:$Web_Form_Parm}} <span class="pageSubtitle"><section begin="desc" />Value of form field<section end="desc" /></span> $Web_Form_Parm retrieves the value of a fie...") |
|||
(22 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$Web_Form_Parm}} | {{DISPLAYTITLE:$Web_Form_Parm}} | ||
<span class="pageSubtitle" | <span class="pageSubtitle">Value of form field</span> | ||
<var>$Web_Form_Parm</var> retrieves the value of a field on a form. | |||
<var>$Web_Form_Parm</var> takes four arguments, and it returns a string (or null for any error condition). | |||
==Syntax== | ==Syntax== | ||
<p class="syntax">< | <p class="syntax"><span class="term">%string</span> = <span class="literal">$Web_Form_Parm</span>( <span class="term">fieldname</span>, <span class="term">occurrence</span>, [<span class="term">start</span>], [<span class="term">len</span>] ) | ||
< | </p> | ||
===Syntax terms=== | |||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>fieldname</th> | <tr><th>fieldname</th> | ||
<td>The name of the form field, returned by $Web_Form_Name. A required argument if occurrence is not specified, otherwise it is optional.</td></tr> | <td>The name of the form field, returned by <var>$Web_Form_Name</var>. A required argument if occurrence is not specified, otherwise it is optional.</td></tr> | ||
<tr><th>occurrence</th> | <tr><th>occurrence</th> | ||
<td>The occurrence number of a form field, or the occurrence number of the form field matching ''fieldname'', if ''fieldname'' is specified. An optional argument if ''fieldname'' is specified, otherwise it is required.</td></tr> | <td>The occurrence number of a form field, or the occurrence number of the form field matching ''fieldname'', if ''fieldname'' is specified. An optional argument if ''fieldname'' is specified, otherwise it is required.</td></tr> | ||
Line 19: | Line 19: | ||
<td>Starting position within the field. This is an optional argument which defaults to 1.</td></tr> | <td>Starting position within the field. This is an optional argument which defaults to 1.</td></tr> | ||
<tr><th>len</th> | <tr><th>len</th> | ||
<td>Length to return. This is an optional argument, provided in case a form field exceeds 255 bytes. The length of a form field can be determined with $Web_Form_Len. The default is the length of the form field. | <td>Length to return. This is an optional argument, provided in case a form field exceeds 255 bytes. The length of a form field can be determined with <var>$Web_Form_Len</var>. The default is the length of the form field. | ||
</td></tr></table> | </td></tr></table> | ||
==Examples== | |||
This example places the value of each parameter on a form into a <var class="product">User Language</var> %variable of the same name. | |||
This example places the value of each parameter on a form into a User Language %variable of the same name. | <p class="code">* Stash the form values in matching fields. | ||
<p class="code"> | |||
%CUSTOMER_NAME = $Web_Form_Parm( 'CUSTOMER_NAME' ) | |||
%CUSTOMER_NUM = $Web_Form_Parm( 'CUSTOMER_NUM' ) | |||
%ORDER_NUM = $Web_Form_Parm( 'ORDER_NUM' ) | |||
%ORDER_DATE = $Web_Form_Parm( 'ORDER_DATE' ) | |||
%ORDER_ITEM = $Web_Form_Parm( 'ORDER_ITEM') | |||
%ORDER_ITEM2 = $Web_Form_Parm( 'ORDER_ITEM', 2) | |||
</p> | </p> | ||
==See also== | |||
See also | |||
<ul> | <ul> | ||
<li><var>[[$Web_Form_Parm_Len]]</var> | |||
<li>[[$Web_Form_Parm_Len]] | <li><var>[[$Web_Form_Name]]</var> | ||
<li>[[$Web_Form_Name]] | <li><var>[[$Web_Num_Form]]</var> | ||
<li>[[$Web_Num_Form]] | <li><var>[[$Web_Form_Parm_Lstr]]</var> | ||
<li>[[$Web_Form_Parm_Lstr]] | <li><var>[[$Web_Form_Parm_Binary]]</var> | ||
</ul> | </ul> | ||
[[Category:Janus Web Server $functions|$Web_Form_Parm]] | [[Category:Janus Web Server $functions|$Web_Form_Parm]] |
Latest revision as of 04:15, 20 February 2020
Value of form field
$Web_Form_Parm retrieves the value of a field on a form.
$Web_Form_Parm takes four arguments, and it returns a string (or null for any error condition).
Syntax
%string = $Web_Form_Parm( fieldname, occurrence, [start], [len] )
Syntax terms
fieldname | The name of the form field, returned by $Web_Form_Name. A required argument if occurrence is not specified, otherwise it is optional. |
---|---|
occurrence | The occurrence number of a form field, or the occurrence number of the form field matching fieldname, if fieldname is specified. An optional argument if fieldname is specified, otherwise it is required. |
start | Starting position within the field. This is an optional argument which defaults to 1. |
len | Length to return. This is an optional argument, provided in case a form field exceeds 255 bytes. The length of a form field can be determined with $Web_Form_Len. The default is the length of the form field. |
Examples
This example places the value of each parameter on a form into a User Language %variable of the same name.
* Stash the form values in matching fields. %CUSTOMER_NAME = $Web_Form_Parm( 'CUSTOMER_NAME' ) %CUSTOMER_NUM = $Web_Form_Parm( 'CUSTOMER_NUM' ) %ORDER_NUM = $Web_Form_Parm( 'ORDER_NUM' ) %ORDER_DATE = $Web_Form_Parm( 'ORDER_DATE' ) %ORDER_ITEM = $Web_Form_Parm( 'ORDER_ITEM') %ORDER_ITEM2 = $Web_Form_Parm( 'ORDER_ITEM', 2)