Class input_dropdown

Description

Dropdown list class.

This class defines a dropdown listbox, it handles input validation, value persistancy, and displaying the object.

  • version: $Revision: 1.3 $

Located in /input.dropdown.php (line 28)

input_base
   |
   --input_form_element
      |
      --input_dropdown
Variable Summary
 array $items
 bool $multiple
Method Summary
 input_dropdown input_dropdown (string $name, object &$form, [string $value = NULL], [array $items = NULL], [string $caption = NULL], [bool $multiple = FALSE])
 void display ([string $class = NULL], [int $visibleItems = 1], [string $javascript = NULL])
 bool set (string $value)
Variables
array $items (line 35)

Array of list items.

bool $multiple (line 42)

Dropdown list allows multiple selection.

Inherited Variables

Inherited from input_form_element

input_form_element::$caption
input_form_element::$form

Inherited from input_base

input_base::$default
input_base::$name
input_base::$regex
input_base::$required
input_base::$value
input_base::$wasSet
input_base::$wasValid
Methods
Constructor input_dropdown (line 54)

Constructs a new dropdown list object.

input_dropdown input_dropdown (string $name, object &$form, [string $value = NULL], [array $items = NULL], [string $caption = NULL], [bool $multiple = FALSE])
  • string $name: The name of the dropdown list.
  • object $form: Reference to associated form.
  • string $value: The initial selected item.
  • array $items: List of items to choose from
  • string $caption: The caption to display by the dropdown list.
  • bool $multiple: Dropdown list allows multiple selection.
display (line 116)

Display the dropdown list.

If the value was not valid, the CSS class is set/changed to 'error'.

void display ([string $class = NULL], [int $visibleItems = 1], [string $javascript = NULL])
  • string $class: CSS class assigned to the dropdown
  • int $visibleItems: Number of visible items (rows) in dropdown/listbox..
  • string $javascript: Specification of javascript: onClick, etc.
set (line 68)

Sets the value of the dropdown list.

  • return: TRUE on success.
bool set (string $value)
  • string $value: The item to select in the dropdown list.

Redefinition of:
input_base::set()
Sets the value of the object to the specified value if that value is valid according to regex given to constructor.

Inherited Methods

Inherited From input_form_element

 input_form_element::input_form_element()
 input_form_element::_get_error_css()

Inherited From input_base

 input_base::input_base()
 input_base::reset()
 input_base::set()

Documentation generated on Fri, 28 Jan 2005 10:00:56 -0800 by phpDocumentor 1.2.3