$Web Sel: 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" />Build select options from global select element, selected is string<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Build select options from global select element, selected is string<section end="desc" /></span>


$Web_Sel inserts into the Web output stream the options list of an HTML<select> element. The options list is taken from a global select element created by $WEB_SAVE_SEL, and the selected option (that is, the one that is highlighted on the HTML page) is specified by a character string. An overview of the $WEB_SEL_x functions is provided in [[$Web_Selp]].


$Web_Sel inserts into the Web output stream the options list of an HTML<select> element. The options list is taken from a global select element created by $WEB_SAVE_SEL, and the selected option (that is, the one that is highlighted on the HTML page) is specified by a character string. An overview of the $WEB_SEL_x functions is provided in [[$Web_Selp]].
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %RC = $Web_Sel(global_name, selected_value, -
<p class="syntax"><section begin="syntax" /> %RC = $Web_Sel(global_name, selected_value, option_keywords)
option_keywords)
<section end="syntax" /></p>
<section end="syntax" /></p>


$Web_Sel is a callable $function (see [[Calling_Sirius_Mods_$functions|Calling Sirius Mods $functions]]).  
$Web_Sel is a callable $function (see [[Calling_Sirius_Mods_$functions|Calling Sirius Mods $functions]]).  


$Web_Sel takes three arguments and returns a string; for some types of errors, the current User Language request is cancelled.  
$Web_Sel takes three arguments and returns a string; for some types of errors, the current User Language request is cancelled.  


<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>global_name</th>
<tr><th>global_name</th>
<td>The name of the global select element containing the values and descriptions for the options list. The global select element with this name must have been created by $Web_Save_Sel. This is a required argument.</td></tr>
<td>The name of the global select element containing the values and descriptions for the options list. The global select element with this name must have been created by $Web_Save_Sel. This is a required argument.</td></tr>
<tr><th>selected_value</th>
<tr><th>selected_value</th>
<td>A string which, if equal to one of the values in the options list, specifies the item that is selected in the displayed options list. This does not allow multiple item selection in a <select&thinsp.multiple> element. This an optional argument. If this argument is omitted, or if the string is not equal to the value of any of the options in the global select element, then none of the <option> elements in the list contain the '''selected''' attribute. As explained in [[$Web_Selp]], the default selected option depends on the type of <select> element: <select&thinsp.multiple> has no default; for non-multiple, the first item in the options list is the default selected element.</td></tr>
<td>A string which, if equal to one of the values in the options list, specifies the item that is selected in the displayed options list. This does not allow multiple item selection in a <select&thinsp.multiple> element. This an optional argument. If this argument is omitted, or if the string is not equal to the value of any of the options in the global select element, then none of the <option> elements in the list contain the '''selected''' attribute. As explained in [[$Web_Selp]], the default selected option depends on the type of <select> element: <select&thinsp.multiple> has no default; for non-multiple, the first item in the options list is the default selected element.</td></tr>
<tr><th>option_keywords</th>
<tr><th>option_keywords</th>
 
<td>A string of blank-separated keywords specifying special processing for this $function. Any of the following is valid:
<table class="syntaxTable">
<table class="syntaxTable">
<td>A string of blank-separated keywords specifying special processing for this $function. Any of the following is valid:</td></tr>
<tr><th>NOCAN</th>
<tr><th>NOCAN</th>
<td>Don't cancel request if ''global_name'' not found</td></tr>
<td>Don't cancel request if ''global_name'' not found</td></tr>
Line 38: Line 29:
<td>End each option with </option>
<td>End each option with </option>
</td></tr></table>
</td></tr></table>
This an optional argument.
This an optional argument.
</td></tr></table>
</td></tr>
</table>


<table class="syntaxTable">
<table class="syntaxTable">
Line 52: Line 42:
specified.<tr><th></th>
specified.<tr><th></th>
<td>Any other error results in cancellation of the User Language request.</td></tr>
<td>Any other error results in cancellation of the User Language request.</td></tr>
</table>
</table>
<p class="caption">$WEB_SEL return values</p>
<p class="caption">$WEB_SEL return values</p>


See [[$Web_Selp]] for an extended example which includes use of $Web_Sel.
See [[$Web_Selp]] for an extended example which includes use of $Web_Sel.


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

Revision as of 21:36, 22 February 2011

<section begin="desc" />Build select options from global select element, selected is string<section end="desc" />

$Web_Sel inserts into the Web output stream the options list of an HTML<select> element. The options list is taken from a global select element created by $WEB_SAVE_SEL, and the selected option (that is, the one that is highlighted on the HTML page) is specified by a character string. An overview of the $WEB_SEL_x functions is provided in $Web_Selp.

Syntax

<section begin="syntax" /> %RC = $Web_Sel(global_name, selected_value, option_keywords) <section end="syntax" />

$Web_Sel is a callable $function (see Calling Sirius Mods $functions).

$Web_Sel takes three arguments and returns a string; for some types of errors, the current User Language request is cancelled.

global_name The name of the global select element containing the values and descriptions for the options list. The global select element with this name must have been created by $Web_Save_Sel. This is a required argument.
selected_value A string which, if equal to one of the values in the options list, specifies the item that is selected in the displayed options list. This does not allow multiple item selection in a <select&thinsp.multiple> element. This an optional argument. If this argument is omitted, or if the string is not equal to the value of any of the options in the global select element, then none of the <option> elements in the list contain the selected attribute. As explained in $Web_Selp, the default selected option depends on the type of <select> element: <select&thinsp.multiple> has no default; for non-multiple, the first item in the options list is the default selected element.
option_keywords A string of blank-separated keywords specifying special processing for this $function. Any of the following is valid:
NOCAN Don't cancel request if global_name not found
NOENDSEL Don't end list of options with </select>
NOENDS Synonym for NOENDSEL
ENDOPT End each option with </option>

This an optional argument.

specified.
Code Meaning
null The operation completed successfully.
1 Global_name not a saved global select element, and NOCAN option
Any other error results in cancellation of the User Language request.

$WEB_SEL return values

See $Web_Selp for an extended example which includes use of $Web_Sel.