$Web_Num_Form
<section begin="desc" />Number of form fields with non-null data<section end="desc" />
$Web_Num_Form retrieves the number of fields on a form containing non-null data.
Syntax
<section begin="syntax" /> %COUNT = $Web_Num_Form( fieldname ) <section end="syntax" />
$Web_Num_Form takes a single optional argument and returns a number.
fieldname | Specifies to count only the form fields that match fieldname. If omitted, returns the count of all form 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.
%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 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:
- [[$Web_Form_Parm_Len]]
- [[$Web_Form_Name]]
- [[$Web_Form_Parm]]