v5:reference:recordset:getmenu3
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
v5:reference:recordset:getmenu3 [2019/01/01 22:09] – mnewnham | v5:reference:recordset:getmenu3 [2019/01/01 22:35] – mnewnham | ||
---|---|---|---|
Line 12: | Line 12: | ||
optional bool $multiple=false, | optional bool $multiple=false, | ||
optional int $numberOfRows=0, | optional int $numberOfRows=0, | ||
- | optional string $optionalAttributes='' | + | optional string $optionalAttributes='' |
- | optional bool $compareSelectedCol0=true | + | |
) | ) | ||
| | ||
Line 19: | Line 18: | ||
</ | </ | ||
===== Description ===== | ===== Description ===== | ||
- | The function '' | + | The function '' |
+ | In order for the optgroup to work correctly, the SQL statement used must be ORDERED by some order that begins with the 3rd column in the SELECT. | ||
===== Parameters ===== | ===== Parameters ===== | ||
Line 26: | Line 26: | ||
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 for a single value to match, or a numeric |
==== $blankFirstLine ==== | ==== $blankFirstLine ==== | ||
true to leave the 1st item in list empty | true to leave the 1st item in list empty | ||
Line 35: | Line 35: | ||
==== $optionalAttributes ==== | ==== $optionalAttributes ==== | ||
Additional attributes to defined for SELECT tag, useful for holding javascript onChange=' | Additional attributes to defined for SELECT tag, useful for holding javascript onChange=' | ||
- | ==== $compareSelectedCol0==== | ||
- | When we determine the selected tag, by default we compare the value provided against the first column in the recordset (the option value). By changing this to false, we compare the value against the second. | ||
===== Usage ===== | ===== Usage ===== | ||
<code php> | <code php> | ||
Line 46: | Line 44: | ||
$result = $db-> | $result = $db-> | ||
- | $html = $result-> | + | $html = $result-> |
+ | array(' | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
print $html | print $html | ||
Line 59: | Line 62: | ||
<option value=' | <option value=' | ||
<option selected=' | <option selected=' | ||
- | <option value=' | + | < |
- | <option value=' | + | < |
<option value=' | <option value=' | ||
</ | </ |
v5/reference/recordset/getmenu3.txt · Last modified: 2019/01/01 23:50 by mnewnham