v5:reference:recordset:getmenu
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
v5:reference:recordset:getmenu [2019/01/01 23:14] – mnewnham | v5:reference:recordset:getmenu [2019/11/23 23:30] – [$blankFirstLine] dregad | ||
---|---|---|---|
Line 10: | Line 10: | ||
== Syntax == | == Syntax == | ||
string getMenu( | string getMenu( | ||
- | | + | string $selectName, |
optional mixed $defaultValue=false, | optional mixed $defaultValue=false, | ||
- | optional | + | optional |
optional bool $multiple=false, | optional bool $multiple=false, | ||
optional int $numberOfRows=0, | optional int $numberOfRows=0, | ||
Line 22: | Line 22: | ||
</ | </ | ||
===== Description ===== | ===== Description ===== | ||
- | The function '' | + | |
- | If the returned | + | The function '' |
- | If the returned recordset | + | |
+ | If the recordset has a single column, the option values and descriptions are the same. | ||
+ | If it has 2 columns, the first one is the description and the second | ||
+ | |||
+ | Any extra column beyond the first two will be discarded. | ||
===== Parameters ===== | ===== Parameters ===== | ||
==== $selectName ===== | ==== $selectName ===== | ||
Line 31: | Line 35: | ||
The value to highlight. Use either a string for a single value to match, or a numeric array if a multiselect box is going to be built and there are multiple matching defaults. | The value to highlight. Use either a string for a single value to match, or a numeric array if a multiselect box is going to be built and there are multiple matching defaults. | ||
==== $blankFirstLine ==== | ==== $blankFirstLine ==== | ||
- | true to leave the 1st item in list empty | + | This parameter has the following available options: |
+ | |||
+ | * true (default) - creates an empty ''< | ||
+ | * false - does not creates an empty ''< | ||
+ | * string value - creates an ''< | ||
+ | * string value format '' | ||
==== $multiple ==== | ==== $multiple ==== | ||
Set true to create a multi-select box | Set true to create a multi-select box | ||
Line 39: | Line 49: | ||
Additional attributes to defined for SELECT tag, useful for holding javascript onChange=' | Additional attributes to defined for SELECT tag, useful for holding javascript onChange=' | ||
==== $compareAgainstFirstCol ==== | ==== $compareAgainstFirstCol ==== | ||
- | If we have 2 columns, by default the default value is located by matching against the 2nd column (the value). By setting this flag to false, we can locate the selected option by matching against the 1st column (the description). | + | If we have 2 columns, by default the default value is located by matching against the 2nd column (the value). By setting this flag to false, we can locate the selected option by matching against the 1st column (the description). |
===== Usage ===== | ===== Usage ===== | ||
<code php> | <code php> |
v5/reference/recordset/getmenu.txt · Last modified: 2019/11/24 00:16 by dregad