$Web Num Form: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$Web_Num_Form}}
{{DISPLAYTITLE:$Web_Num_Form}}
<span class="pageSubtitle"><section begin="desc" />Number of form fields with non-null data<section end="desc" /></span>
<span class="pageSubtitle">Number of form fields with non-null data</span>


<var>$Web_Num_Form</var> retrieves the number of fields on a form containing non-null data.


<var>$Web_Num_Form</var> takes a single optional argument and returns a number.


$Web_Num_Form retrieves the number of fields on a form containing non-null data.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %COUNT = $Web_Num_Form( fieldname )
<p class="syntax"><span class="term">%count</span> = <span class="literal">$Web_Num_Form</span>( [<span class="term">fieldname</span>] )
<section end="syntax" /></p>
</p>


 
===Syntax terms===
$Web_Num_Form takes a single optional argument and returns a number.
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>fieldname</th>
<tr><th>fieldname</th>
<td>Specifies to count only the form fields that match ''fieldname''. If omitted, returns the count of all form fields.
<td>Specifies to count only the form fields that match <var class="term">fieldname</var>. If omitted, returns the count of all form fields.
</td></tr></table>
</td></tr></table>


 
==Examples==
An application written to handle forms generically would need to determine the number of input fields on a form before finding the names of the fields.
An application written to handle forms generically would need to determine the number of input fields on a form before finding the names of the fields.
<p class="code"> %F_COUNT = $Web_Num_Form
<p class="code">%F_COUNT = $Web_Num_Form
IF %F_COUNT EQ 7 THEN
IF %F_COUNT EQ 7 THEN
JUMP TO PROCESS_NETSCAPE
  JUMP TO PROCESS_NETSCAPE
ELSE
ELSE
JUMP TO PROCESS_OTHER_BROWSERS
  JUMP TO PROCESS_OTHER_BROWSERS
END IF
END IF
</p>
</p>


This is sample code from an application that sends a slightly different form to Netscape browser users than it does to other browsers. <var>$Web_Num_Form</var> is used to detect the number of fields on the form, and to route processing accordingly. This example uses the fact that for some reason the number of form fields returned will be 7 for Netscape clients but some other number for other browsers. To more precisely determine what browser the client is using, use "$WEB_HDR_PARM('USER-AGENT')".


This is sample code from an application that sends a slightly different form to Netscape browser users than it does to other browsers. $Web_Num_Form is used to detect the number of fields on the form, and to route processing accordingly. This example uses the fact that for some reason the number of form fields returned will by 7 for Netscape clients but some other number for other browsers. To more precisely determine what browser the client is using, use "$WEB_HDR_PARM('USER-AGENT')".
==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_Form_Parm]]</var>
<li>[[$Web_Form_Parm]]
</ul>
</ul>


[[Category:Janus Web Server $functions|$Web_Num_Form]]
[[Category:Janus Web Server $functions|$Web_Num_Form]]

Latest revision as of 00:59, 16 April 2013

Number of form fields with non-null data

$Web_Num_Form retrieves the number of fields on a form containing non-null data.

$Web_Num_Form takes a single optional argument and returns a number.

Syntax

%count = $Web_Num_Form( [fieldname] )

Syntax terms

fieldname Specifies to count only the form fields that match fieldname. If omitted, returns the count of all form fields.

Examples

An application written to handle forms generically would need to determine the number of input fields on a form before finding the names of the fields.

%F_COUNT = $Web_Num_Form IF %F_COUNT EQ 7 THEN JUMP TO PROCESS_NETSCAPE ELSE JUMP TO PROCESS_OTHER_BROWSERS END IF

This is sample code from an application that sends a slightly different form to Netscape browser users than it does to other browsers. $Web_Num_Form is used to detect the number of fields on the form, and to route processing accordingly. This example uses the fact that for some reason the number of form fields returned will be 7 for Netscape clients but some other number for other browsers. To more precisely determine what browser the client is using, use "$WEB_HDR_PARM('USER-AGENT')".

See also