v5:reference:recordset:getmenu
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| reference:getmenu [2015/08/14 02:50] – created mnewnham | v5:reference:recordset:getmenu [2019/11/24 00:16] (current) – Add wrap around fetch mode note dregad | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ~~NOTOC~~ | ~~NOTOC~~ | ||
| <WRAP right box> | <WRAP right box> | ||
| + | == See Also == | ||
| + | [[v5: | ||
| + | [[v5: | ||
| == Syntax == | == Syntax == | ||
| string getMenu( | string getMenu( | ||
| string $selectName, | string $selectName, | ||
| - | mixed $defaultValue, | + | |
| - | | + | |
| - | bool $multiple, | + | |
| - | int $numberOfRows, | + | |
| - | string $optionalAttributes, | + | |
| - | bool $compareAgainstFirstCol | + | |
| ) | ) | ||
| + | | ||
| + | | ||
| </ | </ | ||
| ===== Description ===== | ===== Description ===== | ||
| - | The function '' | + | |
| + | The function '' | ||
| + | |||
| + | If the recordset | ||
| + | If it has 2 columns, the first one is the description and the second | ||
| + | |||
| + | Any extra column beyond the first two will be discarded. | ||
| + | |||
| + | <WRAP info left> | ||
| + | Until ADOdb 5.20.13, this method required that [[v5: | ||
| + | </ | ||
| ===== Parameters ===== | ===== Parameters ===== | ||
| - | string $selectName, | ||
| - | mixed $defaultValue, | ||
| - | bool $blankFirstItem, | ||
| - | bool $multiple, | ||
| - | int $numberOfRows, | ||
| - | string $optionalAttributes, | ||
| - | bool $compareAgainstFirstCol | ||
| ==== $selectName ===== | ==== $selectName ===== | ||
| name of SELECT tag | name of SELECT tag | ||
| ==== $defaultValue ==== | ==== $defaultValue ==== | ||
| - | The value to highlight. Use an array for multiple | + | The value to highlight. Use either a string |
| - | ==== $bankFirstLine | + | ==== $blankFirstLine |
| - | true to leave the 1st item in list empty | + | This parameter has the following available options: |
| - | * @param [multiple] true for listbox, | + | |
| - | * @param [size] #rows to show for listbox. not used by popup | + | * true (default) - creates an empty ''< |
| - | * @param [selectAttr] additional | + | * false - does not creates an empty ''< |
| - | * useful for holding javascript onChange=' | + | * string value - creates an ''< |
| - | & @param [compareFields0] when | + | * string value format '' |
| - | * column | + | |
| - | * | + | ==== $multiple ==== |
| - | * @return HTML | + | Set true to create a multi-select box |
| + | ==== $numberOfRows ==== | ||
| + | Number of rows to show for multi-select box. If. a multi-select box is not created, this field has no meaning. | ||
| + | ==== $optionalAttributes ==== | ||
| + | Additional | ||
| + | ==== $compareAgainstFirstCol ==== | ||
| + | If we have 2 columns, by default | ||
| + | ===== Usage ===== | ||
| + | <code php> | ||
| + | /* | ||
| + | * Connect to DB2 Sample Database | ||
| + | */ | ||
| + | $SQL = " | ||
| + | $result = $db-> | ||
| + | |||
| + | $html = $result-> | ||
| + | ' | ||
| + | | ||
| + | | ||
| + | | ||
| + | ' | ||
| + | |||
| + | print $html | ||
| + | |||
| + | </ | ||
| + | |||
| + | <code html> | ||
| + | <select name=" | ||
| + | < | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | <option value=' | ||
| + | </ | ||
| + | |||
| + | </ | ||
v5/reference/recordset/getmenu.1439513408.txt.gz · Last modified: (external edit)
