Class TFormLookup

Description

Select Field, values taken from database table

  • version:

    05-29-2002 15:30

    Note: change as of version 5-29, $linkfield added. All existing implementations must make note and modify the call to TFormLookup

  • author: Greg MacLellan

Located in /form-lookup.inc.php (line 15)

TFormElement
   |
   --TFormSelect
      |
      --TFormLookup
Variable Summary
mixed $htmltype
mixed $table
mixed $type
Method Summary
TFormLookup TFormLookup (string $name, string $displayname, string $class, bool $required, TDatabaseAbstract &$db, string $table, string $linkfield, string $displayfield, [string $where = ""], [bool $store = true])
Variables
mixed $htmltype = "select" (line 20)

The HTML element type


Redefinition of:
TFormSelect::$htmltype
The HTML element type
mixed $table (line 16)
mixed $type = "select" (line 18)

The type of element


Redefinition of:
TFormSelect::$type
The type of element

Inherited Variables

Inherited from TFormSelect

TFormSelect::$elements
TFormSelect::$required

Inherited from TFormElement

TFormElement::$alwaysSet
TFormElement::$class
TFormElement::$displayname
TFormElement::$name
TFormElement::$parent
TFormElement::$store
TFormElement::$value
Methods
Constructor TFormLookup (line 43)

Creates a new TFormLookup element (select box with data from another table).

TFormLookup TFormLookup (string $name, string $displayname, string $class, bool $required, TDatabaseAbstract &$db, string $table, string $linkfield, string $displayfield, [string $where = ""], [bool $store = true])
  • string $name: The name of the element. This should correspond to the field name 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
  • bool $required: True if the first element can't be selected
  • TDatabaseAbstract $db: A reference to a connected DatabaseAbstract object, connected to the database you're using.
  • string $table: The table containing the other data.
  • string $linkfield: The field in $table to link to the current table
  • string $displayfield: The field containing the display data. Note this can also be any valid SQL functions that can be used with SELECT. The results are ordered by the value of this field.
  • string $where: A string containg the text for a "WHERE" clause, if used (ie "(Day = 'Monday') AND (ParentID = 46)" )
  • bool $store: Whether this value is persistent. Used by TDBForm to decide to save/load this value from database.

Inherited Methods

Inherited From TFormSelect

TFormSelect::TFormSelect()
TFormSelect::getValue()
TFormSelect::output()
TFormSelect::validate()

Inherited From TFormElement

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

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