$Web Form Parm Num Line: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{DISPLAYTITLE:$Web_Form_Parm_Num_Line}}
{{DISPLAYTITLE:$<var>Web_Form_Parm_Num_Line</var>.}
<span class="pageSubtitle"><section begin="desc" />Number of form field lines<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Number of form field lines<section end="desc" /></span>






$<var>Web_Form_Parm_Num_Line</var> retrieves the number of lines in a form field. It is especially useful for ''textarea'' input fields. $Web_Form_Num_Line is a short synonym for $Web_Form_Parm_Num_Line.
$<var><var>Web_Form_Parm_Num_Line</var>./var> retrieves the number of lines in a form field. It is especially useful for ''textarea'' input fields. $Web_Form_Num_Line is a short synonym for $<var>Web_Form_Parm_Num_Line</var>.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %STRING = $WEB_FORM_[PARM_]NUM_LINE( fieldname, occurrence )
<p class="syntax"><section begin="syntax" /> %STRING = $WEB_FORM_[PARM_]NUM_LINE( fieldname, occurrence )
Line 10: Line 10:




$<var>Web_Form_Parm_Num_Line</var> takes two arguments and returns either the number of lines in the form field or a 0 indicating either that there were no lines in the form field or that some other error has occurred. Possible errors would be the form field not being found or the function being invoked on a non-web server thread.
$<var><var>Web_Form_Parm_Num_Line</var>./var> takes two arguments and returns either the number of lines in the form field or a 0 indicating either that there were no lines in the form field or that some other error has occurred. Possible errors would be the form field not being found or the function being invoked on a non-web server thread.
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>fieldname</th>
<tr><th>fieldname</th>
Line 24: Line 24:
This example checks if the number of lines returned in a textarea exceeds the size of the array meant to hold the input from the textarea.
This example checks if the number of lines returned in a textarea exceeds the size of the array meant to hold the input from the textarea.
<p class="code">  
<p class="code">  
  %LINES = $Web_Form_Parm_Num_Line('COMMENTS')
  %LINES = $<var>Web_Form_Parm_Num_Line</var>.'COMMENTS')
  IF %LINES GT %MAXLINES THEN
  IF %LINES GT %MAXLINES THEN
  AUDIT 'Maximum lines exceeded for ' WITH -
  AUDIT 'Maximum lines exceeded for ' WITH -
Line 44: Line 44:




[[Category:Janus Web Server $functions|$Web_Form_Parm_Num_Line]]
[[Category:Janus Web Server $functions|$<var>Web_Form_Parm_Num_Line</var>.]

Revision as of 18:28, 12 June 2012

{{DISPLAYTITLE:$Web_Form_Parm_Num_Line.} <section begin="desc" />Number of form field lines<section end="desc" />


$Web_Form_Parm_Num_Line./var> retrieves the number of lines in a form field. It is especially useful for textarea input fields. $Web_Form_Num_Line is a short synonym for $Web_Form_Parm_Num_Line.

Syntax

<section begin="syntax" /> %STRING = $WEB_FORM_[PARM_]NUM_LINE( fieldname, occurrence ) <section end="syntax" />


$Web_Form_Parm_Num_Line./var> takes two arguments and returns either the number of lines in the form field or a 0 indicating either that there were no lines in the form field or that some other error has occurred. Possible errors would be the form field not being found or the function being invoked on a non-web server thread.

fieldname The name of the form field, returned by $Web_Form_Name. Required argument if occurrence not specified, otherwise optional.
occurrence The occurrence number of a form field, or the occurrence number of the form field matching 'fieldname', if fieldname is specified. Optional argument if fieldname is specified, otherwise it is required.


A line is considered to be a block of text that is terminated by either an ASCII carriage return (X'0D') or a carriage return followed by a line feed (X'0A'). This is what is ordinarily sent by a browser to mark the end of each line of a textarea input field.

This example checks if the number of lines returned in a textarea exceeds the size of the array meant to hold the input from the textarea.

%LINES = $Web_Form_Parm_Num_Line.'COMMENTS') IF %LINES GT %MAXLINES THEN AUDIT 'Maximum lines exceeded for ' WITH - $Web_Hdr_Parm('URL') WITH - ' - input will be truncated' %LINES = %MAXLINES END IF


See also:


[[Category:Janus Web Server $functions|$Web_Form_Parm_Num_Line.]