auFormSelect: Difference between revisions
Appearance
Misterhaan (talk | contribs) New page: {{RightTOC}} FormSelect Category:Class Category:PHP The auFormSelect class is part of the auLib package. It is defined in the auForm.php file. ;Hierarchy * ... |
Misterhaan (talk | contribs) No edit summary |
||
Line 16: | Line 16: | ||
<code>new auFormSelect($name, ''$label'', ''$tooltip'', ''$values'', ''$default'', ''$type'')</code> | <code>new auFormSelect($name, ''$label'', ''$tooltip'', ''$values'', ''$default'', ''$type'')</code> | ||
Creates a one-value selection field | Creates a one-value selection field. | ||
* $name = Name to submit the field as. | * $name = Name to submit the field as. |
Revision as of 11:30, 24 April 2008
The auFormSelect class is part of the auLib package. It is defined in the auForm.php file.
- Hierarchy
- auFormElement
- auFormField
- auFormSelect
- auFormField
Usage
This class is used to add a one-value selection field to a form. Create an object from this class and add it to an auFormContainer object.
Public Functions
new auFormSelect
new auFormSelect($name, $label, $tooltip, $values, $default, $type)
Creates a one-value selection field.
- $name = Name to submit the field as.
- $label = Label to display with the field. Default is blank.
- $tooltip = Tooltip text to display when the mouse is over the label. Default is none.
- $values = Associative array of possible values (value => display text). If values and display text are all identical, a normal array can be passed through auFormSelect::ArrayIndex($array) to get it into the appropriate format. Default is no possible values.
- $default = Default value for this field. Default is browser default, which is usually the first of the possible values.
- $type = Type of field -- set to _AU_FORM_SELECT_RADIO to use radio buttons. Default is _AU_FORM_SELECT_DROPDOWN for a dropdown selection.
ArrayIndex
ArrayIndex($array)
Translates a normal array into an associative array for use in the values parameter of the auFormSelect constructor. This is a static function.
- $array = Normal array to translate.
- @return = Array translated into associative form.