Public Member Functions | |
__construct ($name, $multiple=false, $size=0) | |
Creates a new select box. | |
addOption ($value, $label) | |
Adds an item/option to the select box. | |
getOptions () | |
Returns a list of all the options that have been added so far. | |
getSelectedIndex () | |
Returns the numerical index of the initially selected item. | |
makeString ($prop, $newValue) | |
INSERT BRIEF DESCRIPTION HERE. |
This class corresponds to the HTML select tag. It also has supports for events that are triggered when changing the selection. When used in TK XML, each item is specified with a <item> tag, which must have a 'value' attribute. The content of the tag is used as the label, or display value. If there is a 'selected' attribute on the item tag and the value of the attribute is 'true', then the item is set as the initially selected item. Should there be multiple item tags with a 'selected="true"' attribute, only the last one will count.
string
: name of initially selected element boolean
: if true, then a multi-select box is used, otherwise a drop-down is used
TKSelect::__construct | ( | $ | name, | |
$ | multiple = false , |
|||
$ | size = 0 | |||
) |
Creates a new select box.
$name | [string]: form element name | |
$multiple | [boolean]: whether to have multi-select (true) or drop-down (false) | |
$size | [int]: if $multiple is true, the number of rows in the selector box |
TKSelect::addOption | ( | $ | value, | |
$ | label | |||
) |
Adds an item/option to the select box.
The value is what the whole select element is set to when the user submits the form. The label is what is displayed to the user for that item.
$value | [string]: item value | |
$label | [string]: what the user sees |
TKSelect::getOptions | ( | ) |
Returns a list of all the options that have been added so far.
TKSelect::getSelectedIndex | ( | ) |
Returns the numerical index of the initially selected item.
TKSelect::makeString | ( | $ | prop, | |
$ | newValue | |||
) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
$prop | [TYPE]: DESCRIPTION | |
$newValue | [TYPE]: DESCRIPTION |