$Web Save Sel: Difference between revisions
(Created page with "{{DISPLAYTITLE:$Web_Save_Sel}} <span class="pageSubtitle"><section begin="desc" />Save a global select element<section end="desc" /></span> $Web_Save_Sel creates a global sele...") |
m (→Syntax) |
||
(25 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$Web_Save_Sel}} | {{DISPLAYTITLE:$Web_Save_Sel}} | ||
<span class="pageSubtitle" | <span class="pageSubtitle">Save a global select element</span> | ||
<var>$Web_Save_Sel</var> creates a global select element and saves the list of values (and, optionally, corresponding description strings) in CCATEMP pages. The name of the select element can be used in the $Web_Sel* functions to build an HTML <code><select></code> element, or to check that a set of values contains only valid selections for the select element. An overview of the $Web_Sel* functions is provided in <var>[[$Web_Selp]]</var>. | |||
<var>$Web_Save_Sel</var> is a [[Calling_Sirius_Mods_$functions|callable]] $function, and it can be run from a non-<var class="product">[[Janus Web Server]]</var> thread. | |||
$Web_Save_Sel | <var>$Web_Save_Sel</var> takes three arguments and always returns zero, unless an error occurs, in which case the current <var class="product">User Language</var> request is cancelled. | ||
==Syntax== | ==Syntax== | ||
<p class="syntax">< | <p class="syntax"><span class="term">%rc</span> = <span class="literal">$Web_Save_Sel</span>(<span class="term"> global_name, values,</span> [<span class="term">descriptions</span>] ) | ||
< | </p> | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>global_name</th> | <tr><th>global_name</th> | ||
<td>The name of the global select element to create. This name can be used by the $ | <td>The name of the global select element to create. This name can be used by the $Web_Sel* functions to build a select options list or to check a set of selected values. If a global select element by this name already exists, it is deleted before the new element is created.</td></tr> | ||
<tr><th>values</th> | <tr><th>values</th> | ||
<td>The identifier of a $list that contains the select options list values. Each $list item contains one value.</td></tr> | <td>The identifier of a $list that contains the select options list values. Each $list item contains one value.</td></tr> | ||
<tr><th>descriptions</th> | <tr><th>descriptions</th> | ||
<td>The identifier of a $list that contains the select options list descriptions. The descriptions are the strings that are displayed when a browser user clicks on a <code><select></code> element. | |||
<p> | |||
This is an optional argument; if omitted, any select options list generated by the $Web_Sel* functions will have descriptions identical to the option values. The number of items in this $list must be the same as the number of items in the values $list. | |||
</p></td></tr></table> | |||
===Return codes=== | |||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>Code</th> | <tr><th>Code</th> | ||
< | <th>Meaning</th></tr> | ||
<tr><th>0</th> | <tr><th>0</th> | ||
<td>The operation completed successfully.</td></tr> | <td>The operation completed successfully.</td></tr> | ||
<tr><th></th> | <tr><th></th> | ||
<td>Any error results in cancellation of the User Language request.</td></tr> | <td>Any error results in cancellation of the <var class="product">User Language</var> request.</td></tr> | ||
</table> | </table> | ||
See [[$Web_Selp]] for an extended example which includes use of $Web_Save_Sel. | ==Examples== | ||
See <var>[[$Web_Selp]]</var> for an extended example which includes use of <var>$Web_Save_Sel</var>. | |||
[[Category:Janus Web Server $functions|$Web_Save_Sel]] | [[Category:Janus Web Server $functions|$Web_Save_Sel]] |
Latest revision as of 21:40, 5 June 2013
Save a global select element
$Web_Save_Sel creates a global select element and saves the list of values (and, optionally, corresponding description strings) in CCATEMP pages. The name of the select element can be used in the $Web_Sel* functions to build an HTML <select>
element, or to check that a set of values contains only valid selections for the select element. An overview of the $Web_Sel* functions is provided in $Web_Selp.
$Web_Save_Sel is a callable $function, and it can be run from a non-Janus Web Server thread.
$Web_Save_Sel takes three arguments and always returns zero, unless an error occurs, in which case the current User Language request is cancelled.
Syntax
%rc = $Web_Save_Sel( global_name, values, [descriptions] )
global_name | The name of the global select element to create. This name can be used by the $Web_Sel* functions to build a select options list or to check a set of selected values. If a global select element by this name already exists, it is deleted before the new element is created. |
---|---|
values | The identifier of a $list that contains the select options list values. Each $list item contains one value. |
descriptions | The identifier of a $list that contains the select options list descriptions. The descriptions are the strings that are displayed when a browser user clicks on a <select> element.
This is an optional argument; if omitted, any select options list generated by the $Web_Sel* functions will have descriptions identical to the option values. The number of items in this $list must be the same as the number of items in the values $list. |
Return codes
Code | Meaning |
---|---|
0 | The operation completed successfully. |
Any error results in cancellation of the User Language request. |
Examples
See $Web_Selp for an extended example which includes use of $Web_Save_Sel.