HTML Textbox

author Timo A. Hummel

 Methods

Constructor Function Initializes the SGML open/close tags

__construct() : void
Inherited

inherited_from \cHTML::__construct()
inherited_from \cHTMLFormElement::__construct()
inherited_from \cHTMLTextbox::__construct()

_setContent: Sets the content of the object

_setContent(\$content $content) 
Inherited

inherited_from \cHTML::_setContent()
inherited_from \cHTMLFormElement::_setContent()
inherited_from \cHTMLTextbox::_setContent()

Parameters

$content

\$content

string/object String with the content or an object to render.

addRequiredScript()

addRequiredScript($script) 
Inherited

inherited_from \cHTML::addRequiredScript()
inherited_from \cHTMLFormElement::addRequiredScript()
inherited_from \cHTMLTextbox::addRequiredScript()

Parameters

$script

advances to the next ID available in the system.

advanceID() 
Inherited

This function is useful if you need to use HTML elements in a loop, but don't want to re-create new objects each time.

inherited_from \cHTML::advanceID()
inherited_from \cHTMLFormElement::advanceID()
inherited_from \cHTMLTextbox::advanceID()

attachEventDefinition: Attaches the code for an event

attachEventDefinition(\$sName $sName, \$sEvent $sEvent, \$sCode $sCode) 
Inherited

Example to attach an onClick handler: setEventDefinition("foo", "onClick", "alert('foo');");

inherited_from \cHTML::attachEventDefinition()
inherited_from \cHTMLFormElement::attachEventDefinition()
inherited_from \cHTMLTextbox::attachEventDefinition()

Parameters

$sName

\$sName

string defines the name of the event

$sEvent

\$sEvent

string defines the event (e.g. onClick)

$sCode

\$sCode

string defines the code

attachStyleDefinition: Attaches a style definition.

attachStyleDefinition(\$sName $sName, \$sDefinition $sDefinition) : string
Inherited

This function is not restricted to a single style, e.g. you can set multiple style definitions as-is to the handler.

$example->attachStyle("myIdentifier", "border: 1px solid black; white-space: nowrap"); $example->attachStyle("myIdentifier2", "padding: 0px");

Results in:

style="border: 1px solid black; white-space: nowrap; padding: 0px;"

inherited_from \cHTML::attachStyleDefinition()
inherited_from \cHTMLFormElement::attachStyleDefinition()
inherited_from \cHTMLTextbox::attachStyleDefinition()

Parameters

$sName

\$sName

string Name for a style definition

$sDefinition

\$sDefinition

string Definition for the given entity

Returns

stringfilled SGML closing skeleton

cDatefield()

cDatefield($name, $initvalue, $width) 

Parameters

$name

$initvalue

$width

old Constructor

cHTML() 
Inherited

inherited_from \cHTML::cHTML()
inherited_from \cHTMLFormElement::cHTML()
inherited_from \cHTMLTextbox::cHTML()

Constructor. This is a generic form element, where specific elements should be inherited from this class.

cHTMLFormElement(\$name $name, \$id $id, \$disabled $disabled, \$tabindex $tabindex, \$accesskey $accesskey) : \none
Inherited

inherited_from \cHTMLFormElement::cHTMLFormElement()
inherited_from \cHTMLTextbox::cHTMLFormElement()

Parameters

$name

\$name

string Name of the element

$id

\$id

string ID of the element

$disabled

\$disabled

string Item disabled flag (non-empty to set disabled)

$tabindex

\$tabindex

string Tab index for form elements

$accesskey

\$accesskey

string Key to access the field

Returns

\none

Constructor. Creates an HTML text box.

cHTMLTextbox(\$name $name, \$initvalue $initvalue, \$width $width, \$maxlength $maxlength, \$id $id, \$disabled $disabled, \$tabindex $tabindex, \$accesskey $accesskey) : \none
Inherited

If no additional parameters are specified, the default width is 20 units.

inherited_from \cHTMLTextbox::cHTMLTextbox()

Parameters

$name

\$name

string Name of the element

$initvalue

\$initvalue

string Initial value of the box

$width

\$width

int width of the text box

$maxlength

\$maxlength

int maximum input length of the box

$id

\$id

string ID of the element

$disabled

\$disabled

string Item disabled flag (non-empty to set disabled)

$tabindex

\$tabindex

string Tab index for form elements

$accesskey

\$accesskey

string Key to access the field

Returns

\none

fillCloseSkeleton: Fills the close skeleton

fillCloseSkeleton() : string
Inherited

inherited_from \cHTML::fillCloseSkeleton()
inherited_from \cHTMLFormElement::fillCloseSkeleton()
inherited_from \cHTMLTextbox::fillCloseSkeleton()

Returns

stringfilled SGML closer skeleton

fillSkeleton: Fills the open SGML tag skeleton

fillSkeleton(\$attributes $attributes) : string
Inherited

fillSkeleton fills the SGML opener tag with the specified attributes. Attributes need to be passed in the stringyfied variant.

inherited_from \cHTML::fillSkeleton()
inherited_from \cHTMLFormElement::fillSkeleton()
inherited_from \cHTMLTextbox::fillSkeleton()

Parameters

$attributes

\$attributes

string Attributes to set

Returns

stringfilled SGML opener skeleton

getID: returns the current ID

getID() : string
Inherited

inherited_from \cHTML::getID()
inherited_from \cHTMLFormElement::getID()
inherited_from \cHTMLTextbox::getID()

Returns

stringcurrent ID

render(): Alias for toHtml

render() : string

Returns

stringRendered HTML

sets the access key for this element.

setAccessKey(\$accesskey $accesskey) : \none
Inherited

inherited_from \cHTMLFormElement::setAccessKey()
inherited_from \cHTMLTextbox::setAccessKey()

Parameters

$accesskey

\$accesskey

string The length of the access key. May be A-Z and 0-9.

Returns

\none

setAlt: sets the alt and title attributes

setAlt(\$alt $alt) 
Inherited

Sets the "alt" and "title" tags. Usually, "alt" is used for accessibility and "title" for mouse overs.

To set the text for all browsers for mouse over, set "alt" and "title". IE behaves incorrectly and shows "alt" on mouse over. Mozilla browsers only show "title" as mouse over.

inherited_from \cHTML::setAlt()
inherited_from \cHTMLFormElement::setAlt()
inherited_from \cHTMLTextbox::setAlt()

Parameters

$alt

\$alt

string Text to set as the "alt" attribute

setAttribte: Sets a specific attribute

setAttribute(\$sAttributeName $sAttributeName, \$sValue $sValue) 
Inherited

inherited_from \cHTML::setAttribute()
inherited_from \cHTMLFormElement::setAttribute()
inherited_from \cHTMLTextbox::setAttribute()

Parameters

$sAttributeName

\$sAttributeName

string Name of the attribute

$sValue

\$sValue

string Value of the attribute

sets the CSS class

setClass(\$class $class) 
Inherited

inherited_from \cHTML::setClass()
inherited_from \cHTMLFormElement::setClass()
inherited_from \cHTMLTextbox::setClass()

Parameters

$class

\$class

string Text to set as the "alt" attribute

setContentlessTag()

setContentlessTag(\type $contentlessTag) 
Inherited

inherited_from \cHTML::setContentlessTag()
inherited_from \cHTMLFormElement::setContentlessTag()
inherited_from \cHTMLTextbox::setContentlessTag()

Parameters

$contentlessTag

\type

Sets the "disabled" attribute of an element. User Agents usually are showing the element as "greyed-out".

setDisabled(\$disabled $disabled) : \none
Inherited

Example: $obj->setDisabled("disabled"); $obj->setDisabled("");

The first example sets the disabled flag, the second one removes the disabled flag.

inherited_from \cHTMLFormElement::setDisabled()
inherited_from \cHTMLTextbox::setDisabled()

Parameters

$disabled

\$disabled

string Sets the disabled-flag if non-empty

Returns

\none

adds an "onXXX" javascript event handler

setEvent(\$event $event, \$action $action) 
Inherited

example: $item->setEvent("change","document.forms[0].submit");

inherited_from \cHTML::setEvent()
inherited_from \cHTMLFormElement::setEvent()
inherited_from \cHTMLTextbox::setEvent()

Parameters

$event

\$event

string Type of the event

$action

\$action

string Function or action to call (JavaScript Code)

sets the ID class

setID(\$class $id) 
Inherited

inherited_from \cHTML::setID()
inherited_from \cHTMLFormElement::setID()
inherited_from \cHTMLTextbox::setID()

Parameters

$id

\$class

string Text to set as the "id"

sets the maximum input length of the text box.

setMaxLength(\$maxlen $maxlen) : \none
Inherited

inherited_from \cHTMLTextbox::setMaxLength()

Parameters

$maxlen

\$maxlen

int maximum input length

Returns

\none

sets the CSS style

setStyle(\$class $style) 
Inherited

inherited_from \cHTML::setStyle()
inherited_from \cHTMLFormElement::setStyle()
inherited_from \cHTMLTextbox::setStyle()

Parameters

$style

\$class

string Text to set as the "alt" attribute

addStyleDefinition

setStyleDefinition(\$entity $entity, \$definition $definition) : string
Inherited

inherited_from \cHTML::setStyleDefinition()
inherited_from \cHTMLFormElement::setStyleDefinition()
inherited_from \cHTMLTextbox::setStyleDefinition()

Parameters

$entity

\$entity

string Entity to define

$definition

\$definition

string Definition for the given entity

Returns

stringfilled SGML closing skeleton

sets the tab index for this element. The tab index needs to be numeric, bigger than 0 and smaller than 32767.

setTabindex(\$tabindex $tabindex) : \none
Inherited

inherited_from \cHTMLFormElement::setTabindex()
inherited_from \cHTMLTextbox::setTabindex()

Parameters

$tabindex

\$tabindex

int desired tab index

Returns

\none

sets the initial value of the text box.

setValue(\$value $value) : \none
Inherited

inherited_from \cHTMLTextbox::setValue()

Parameters

$value

\$value

string Initial value

Returns

\none

sets the width of the text box.

setWidth(\$width $width) : \none
Inherited

inherited_from \cHTMLTextbox::setWidth()

Parameters

$width

\$width

int width of the text box

Returns

\none

Renders the output If the tag

toHTML() 
Inherited

inherited_from \cHTML::toHTML()
inherited_from \cHTMLFormElement::toHTML()
inherited_from \cHTMLTextbox::toHTML()

Renders the textbox

toHtml() : string
Inherited

inherited_from \cHTMLTextbox::toHtml()

Returns

stringRendered HTML

removes an event handler

unsetEvent(\$event $event) 
Inherited

example: $item->unsetEvent("change");

inherited_from \cHTML::unsetEvent()
inherited_from \cHTMLFormElement::unsetEvent()
inherited_from \cHTMLTextbox::unsetEvent()

Parameters

$event

\$event

string Type of the event

 Properties

 

Defines which JS events contain which scripts

$_aEventDefinitions 
Inherited

inherited_from \cHTML::$$_aEventDefinitions
inherited_from \cHTMLFormElement::$$_aEventDefinitions
inherited_from \cHTMLTextbox::$$_aEventDefinitions
 

Style definitions

$_aStyleDefinitions 
Inherited

inherited_from \cHTML::$$_aStyleDefinitions
inherited_from \cHTMLFormElement::$$_aStyleDefinitions
inherited_from \cHTMLTextbox::$$_aStyleDefinitions
 

The content itself

$_content 
Inherited

inherited_from \cHTML::$$_content
inherited_from \cHTMLFormElement::$$_content
inherited_from \cHTMLTextbox::$$_content
 

Defines if the current tag is a contentless tag

$_contentlessTag : boolean
Inherited

access private
inherited_from \cHTML::$$_contentlessTag
inherited_from \cHTMLFormElement::$$_contentlessTag
inherited_from \cHTMLTextbox::$$_contentlessTag
 

$_oDate

$_oDate 

 

Defines all scripts which are required by the current element

$_requiredScripts : array
Inherited

access private
inherited_from \cHTML::$$_requiredScripts
inherited_from \cHTMLFormElement::$$_requiredScripts
inherited_from \cHTMLTextbox::$$_requiredScripts
 

Storage of the close SGML tag

$_skeleton_close : string
Inherited

access private
inherited_from \cHTML::$$_skeleton_close
inherited_from \cHTMLFormElement::$$_skeleton_close
inherited_from \cHTMLTextbox::$$_skeleton_close
 

Storage of the open SGML tag template

$_skeleton_open : string
Inherited

access private
inherited_from \cHTML::$$_skeleton_open
inherited_from \cHTMLFormElement::$$_skeleton_open
inherited_from \cHTMLTextbox::$$_skeleton_open
 

Storage of a single SGML tag template

$_skeleton_single : string
Inherited

access private
inherited_from \cHTML::$$_skeleton_single
inherited_from \cHTMLFormElement::$$_skeleton_single
inherited_from \cHTMLTextbox::$$_skeleton_single
 

Defines the style definitions

$_styledefs : string
Inherited

access private
inherited_from \cHTML::$$_styledefs
inherited_from \cHTMLFormElement::$$_styledefs
inherited_from \cHTMLTextbox::$$_styledefs
 

Defines which tag to use

$_tag : string
Inherited

access private
inherited_from \cHTML::$$_tag
inherited_from \cHTMLFormElement::$$_tag
inherited_from \cHTMLTextbox::$$_tag