Class TFormCheckbox

Description

Basic Text Field

  • version: 03-08-2002 12:00
  • author: Greg MacLellan

Located in /form-checkbox.inc.php (line 28)

TFormElement
   |
   --TFormCheckbox
Variable Summary
mixed $chk_txt
mixed $chk_val
mixed $htmltype
mixed $state
mixed $type
mixed $unchk_txt
mixed $unchk_val
Method Summary
TFormCheckbox TFormCheckbox (string $name, string $displayname, string $class, [array $values = array(0=>"No",1=>"Yes")], [bool $checked = false], [bool $state = FORMCHECKBOX_STATE_ANY], [bool $store = true])
A getValue ([$display $display = false])
void output ()
true setValue (mixed $value, [bool $user = false])
void validate ()
Variables
mixed $chk_txt (line 33)
mixed $chk_val (line 32)
mixed $htmltype = "checkbox" (line 39)

The HTML element type


Redefinition of:
TFormElement::$htmltype
The HTML element type
mixed $state (line 29)
mixed $type = "checkbox" (line 37)

The type of element


Redefinition of:
TFormElement::$type
The type of element
mixed $unchk_txt (line 31)
mixed $unchk_val (line 30)

Inherited Variables

Inherited from TFormElement

TFormElement::$alwaysSet
TFormElement::$class
TFormElement::$displayname
TFormElement::$name
TFormElement::$parent
TFormElement::$store
TFormElement::$value
Methods
Constructor TFormCheckbox (line 62)

Creates a new TFormCheckbox element (basic text field).

TFormCheckbox TFormCheckbox (string $name, string $displayname, string $class, [array $values = array(0=>"No",1=>"Yes")], [bool $checked = false], [bool $state = FORMCHECKBOX_STATE_ANY], [bool $store = true])
  • string $name: The name of the element. This should correspond to the field names if using with TDBForm, and should not include any spaces or special characters.
  • string $displayname: The name that should show up to the user for this field.
  • string $class: The HTML Class to use for the element
  • array $values: The storable and display values in an associative array. The first element is for unchecked, the second for checked
  • bool $checked: The initial checked value of the field. Note this will be overridden when using TDBForm::loadData()
  • bool $state: FORMCHECKBOX_STATE_ANY for normal operation, or FORMCHECKBOX_STATE_CHECKED if it has to be checked to be valid, or FORMCHECKBOX_STATE_UNCHECKED if it has to be unchecked.
  • bool $store: True if this value is persistent. Used by TDBForm to decide to save/load this value from database.
getValue (line 109)

Returns a textual description of the current value

  • return: string containing the value of the element
A getValue ([$display $display = false])
  • $display $display: True if the value is going to be used for display

Redefinition of:
TFormElement::getValue()
Returns a textual description of the current value
output (line 84)
void output ()

Redefinition of:
TFormElement::output()
Outputs the HTML for this tag
setValue (line 95)

Sets the checked state of the field. If there is any "value" then it sets checked to true.

  • return: if the value was set
true setValue (mixed $value, [bool $user = false])
  • mixed $value: The value to set
  • bool $user: True if the value is from user input

Redefinition of:
TFormElement::setValue()
Sets the value of the field
validate (line 74)
void validate ()

Redefinition of:
TFormElement::validate()
Validates the data in this field.

Inherited Methods

Inherited From TFormElement

TFormElement::TFormElement()
TFormElement::getValue()
TFormElement::output()
TFormElement::setParent()
TFormElement::setValue()
TFormElement::validate()

Documentation generated on Thu, 27 Nov 2003 14:58:52 -0500 by phpDocumentor 1.2.3