Returns the value of the <select> element
Please note that the returned value may not necessarily be equal to that passed to setValue(). It passes "intrinsic validation" confirming that such value could possibly be submitted by this <select> element. Specifically, this method will return null if the elements "disabled" attribute is set, it will not return values if there are no options having such a "value" attribute or if such options' "disabled" attribute is set. It will also only return a scalar value for single selects, mimicking the common browsers' behaviour.
Overrides
HTML_QuickForm2_Node::getRawValue() (Returns the element's value without filters applied)
$this loadOptions(
array
$options)
|
|
Loads <option>s (and <optgroup>s) for select element
The method expects a array of options and optgroups:
array(
'option value 1' => 'option text 1',
...
'option value N' => 'option text N',
'optgroup label 1' => array(
'option value' => 'option text',
...
),
...
)
If value is a scalar, then array key is treated as "value" attribute of <option> and value as this <option>'s text. If value is an array, then key is treated as a "label" attribute of <optgroup> and value as an array of <option>s for this <optgroup>.
If you need to specify additional attributes for <option> and <optgroup> tags, then you need to use addOption() and addOptgroup() methods instead of this one.
Parameters: