TKFormElement Class Reference
[Form Elements]

Base class for all form elements. More...

Inheritance diagram for TKFormElement:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 __construct ($name, $value)
 Called by descendent classes.

Static Public Member Functions

static createFromXML ($attrs, $value, $node)

Protected Member Functions

 getStandardProperties ()
 Returns HTML attributes for the common form attributes.


Detailed Description

Base class for all form elements.

Properties:
  • name string: element name, for use in processing forms
  • disabled boolean: whether element is disabled (can't edit)
  • value string: elements default value

Events:
  • onchange: JavaScript onchange event (value has changed)
  • onsubmit: JavaScript onsubmit event (form containing element has been submitted)
  • onreset: JavaScript onreset event (form has been reset to default values)
  • onselect: JavaScript onselect event (new value selected in multi-value chooser-type element)
  • onblur: JavaScript onblur event (element has lost input focus)
  • onfocus: JavaScript onfocus event (element has gained input focus)

Definition at line 21 of file TKFormElement.php5.


Constructor & Destructor Documentation

TKFormElement::__construct ( name,
value 
)

Called by descendent classes.

Parameters:
$name [string]: initial value for 'name' property
$value [string]: initial value for 'value' property

Definition at line 28 of file TKFormElement.php5.

References TKComponent::addEvent(), and TKComponent::addProperty().


Member Function Documentation

static TKFormElement::createFromXML ( attrs,
value,
node 
) [static]

For internal use only.

Reimplemented from TKComponent.

Reimplemented in TKFormInput, TKSelect, and TKTextArea.

Definition at line 76 of file TKFormElement.php5.

TKFormElement::getStandardProperties (  )  [protected]

Returns HTML attributes for the common form attributes.

For internal use only.

The attributes are 'disabled', 'name' and 'value'. If any of these are set, an appropriate 'attr="value"' string is generated, otherwise the string is blank. All three are returned in array.

Returns:
[array] array of strings, the first for 'name', the second for 'disabled' and the last for 'value'.

Definition at line 56 of file TKFormElement.php5.

Referenced by TKTextArea::renderComponent(), TKSelect::renderComponent(), and TKFormInput::renderComponent().


The documentation for this class was generated from the following file:

Generated on Wed Nov 24 02:07:00 2010 for Common by  doxygen 1.5.6