Class form_field

Description

Form Field class Abstract field class, for deriving various form field types.

This class holds the basic properties and methods which are inherited by all form fields.

Located in /form-defs.php (line 594)

RenderableObject
   |
   --StylableObject
      |
      --HTMLObject
         |
         --form_field
Direct descendents
Class Description
 class form_labelfield Label Field class This is just to display a bare value where the form element would normally be, and where we dont want to use a form_textfield in non-editable mode because we don't want the hidden field..
 class form_hiddenfield Hidden Field class This class generates a hidden field.
 class form_buttonfield Button Field class This virtual class generates a standard form button field. This is a virtual class, used to provide a basis for real buttons. Do not instantiate this as an object - use the descendants instead.
 class form_textfield Text Field class. This class generates a text field.
 class form_fileuploadfield File Upload Field class A field for uploading files to the webserver. If used with a 'form' object, the form will be automatically rendered with the proper encoding type by setting the 'enctype' in the form tag.
 class form_checkbox Checkbox Field class A field which renders a checkbox form element.
 class form_radiobutton Radio Button Field class A field which renders a radio form element.
Variable Summary
 mixed $disabled
 mixed $editable
 mixed $label
 mixed $type
 mixed $value
Method Summary
 form_field form_field ([string $name = ""], [string $label = ""], [string $value = ""], [boolean $editable = EDITABLE], [mixed $css = ""], string $style)
 string as_displayonly ()
 string as_hiddenfield ()
 void setlabel (string $label)
 void setvalue (mixed $value)
 void set_displayonly ()
Variables
Methods
Constructor form_field (line 618)

Constructor Create a field object. Sets basic field attributes.

form_field form_field ([string $name = ""], [string $label = ""], [string $value = ""], [boolean $editable = EDITABLE], [mixed $css = ""], string $style)
  • string $name: The name of the field
  • string $label: The label which can be displayed alongside the field
  • string $value: The value of the field
  • boolean $editable: Editability: EDITABLE or DISPLAY_ONLY (true or false)
  • string $style: Style to apply to the field
as_displayonly (line 654)

Returns current element as text, with associated hidden field.

  • return: HTML for hidden field version of current field.
string as_displayonly ()
as_hiddenfield (line 646)

Returns current element as a hidden field.

  • return: HTML for hidden field version of current field.
string as_hiddenfield ()
disable_autocomplete (line 667)

Disable the autocomplete form functionality of the browser for this field. Browsers have, mainly for password fields, been offering auto-completion of contents. This function will stop this from being done, in browsers which obey the "autocomplete='off'" attribute.

By default autocomplete is "true" for every field. The attribute is only ever rendered when autocomplete is "false".

void disable_autocomplete ()
setlabel (line 632)

Set the label associated with the field

void setlabel (string $label)
  • string $label: The label to set for this field
setvalue (line 638)

Set the value of the field

void setvalue (mixed $value)
  • mixed $value: The value to set for this field
set_displayonly (line 626)

Set the field to be display-only (non-editable)

void set_displayonly ()

Inherited Methods

Inherited From HTMLObject

 HTMLObject::HTMLObject()
 HTMLObject::inherit_attributes()
 HTMLObject::setaccesskey()
 HTMLObject::setalign()
 HTMLObject::setalt()
 HTMLObject::setbackground()
 HTMLObject::setbgcolor()
 HTMLObject::setborder()
 HTMLObject::setcolor()
 HTMLObject::setheight()
 HTMLObject::sethspace()
 HTMLObject::setlang()
 HTMLObject::setlangdir()
 HTMLObject::setname()
 HTMLObject::setsize()
 HTMLObject::setsrc()
 HTMLObject::settabindex()
 HTMLObject::settarget()
 HTMLObject::settitle()
 HTMLObject::setvalign()
 HTMLObject::setvspace()
 HTMLObject::setwidth()
 HTMLObject::set_attribute()
 HTMLObject::set_linkover_text()
 HTMLObject::set_onblur()
 HTMLObject::set_onchange()
 HTMLObject::set_onclick()
 HTMLObject::set_ondblclick()
 HTMLObject::set_onfocus()
 HTMLObject::set_onkeydown()
 HTMLObject::set_onkeypress()
 HTMLObject::set_onkeyup()
 HTMLObject::set_onload()
 HTMLObject::set_onmousedown()
 HTMLObject::set_onmousemove()
 HTMLObject::set_onmouseout()
 HTMLObject::set_onmouseover()
 HTMLObject::set_onmouseup()
 HTMLObject::set_onselect()
 HTMLObject::set_tabindex()
 HTMLObject::taghtml()

Inherited From StylableObject

 StylableObject::StylableObject()
 StylableObject::clearstyle()
 StylableObject::setclass()
 StylableObject::setcss()
 StylableObject::setid()
 StylableObject::setstyle()

Inherited From RenderableObject

 RenderableObject::RenderableObject()
 RenderableObject::html()
 RenderableObject::render()
 RenderableObject::wml()
 RenderableObject::wmlup()
 RenderableObject::xml()

Documentation generated by phpDocumentor 1.3.0RC3