cHTMLTextbox class represents a textbox.

deprecated 2012-03-10 This class is not longer supported.
package Core

 Methods

Constructor.

__construct(string $name, string $initvalue, int $width, int $maxlength, string $id, string $disabled, string $tabindex, string $accesskey, string $class) : void
Inherited

Creates an HTML text box.

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

inherited_from \cHTMLTextbox::__construct()
inherited_from \cDatefield::__construct()

Parameters

$name

string

Name of the element

$initvalue

string

Initial value of the box

$width

int

width of the text box

$maxlength

int

maximum input length of the box

$id

string

ID of the element

$disabled

string

Item disabled flag (non-empty to set disabled)

$tabindex

string

Tab index for form elements

$accesskey

string

Key to access the field

$class

string

the class of this element

Direct call of object as string will return it's generated markup.

__toString() : string
Inherited
inherited_from \cHTML::__toString()
inherited_from \cHTMLFormElement::__toString()
inherited_from \cHTMLTextbox::__toString()
inherited_from \cDatefield::__toString()

Returns

stringGenerated markup

Adds a required script to the current element.

addRequiredScript(string $script) : \cHTML
Inherited

Anyway, scripts are not included twice.

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

Parameters

$script

string

the script to include

Returns

\cHTML$this

Advances to the next ID available in the system.

advanceID() : \cHTML
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()
inherited_from \cDatefield::advanceID()

Returns

\cHTML$this

Appends the given style definition to the HTML element.

appendStyleDefinition(string $property, string $value) : \cHTML
Inherited

Example usage: $element->appendStyleDefinition('margin', '5px');

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

Parameters

$property

string

the property name, e.g. 'margin'

$value

string

the value of the property, e.g. '5px'

Returns

\cHTML$this

Appends the given style definitions to the HTML element.

appendStyleDefinitions(array $styles) : \cHTML
Inherited

Example usage: $element->appendStyleDefinitions(array( 'margin' => '5px', 'padding' => '0' ));

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

Parameters

$styles

string

the styles to append

Returns

\cHTML$this

Attaches the code for an event

attachEventDefinition(string $name, string $event, string $code) : \cHTML
Inherited

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

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

Parameters

$name

string

Defines the name of the event

$event

string

Defines the event (e.g. onClick)

$code

string

Defines the code

Returns

\cHTML$this

Attaches a style definition.

attachStyleDefinition(string $name, string $definition) : \cHTML
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()
inherited_from \cDatefield::attachStyleDefinition()

Parameters

$name

string

Name for a style definition

$definition

string

Definition for the given entity

Returns

\cHTML$this

cDateChooser()

cDateChooser($name, $initValue) 

Parameters

$name

$initValue

cDatefield()

cDatefield($name, $initvalue, $width) 
Inherited
inherited_from \cDatefield::cDatefield()

Parameters

$name

$initvalue

$width

cHTML()

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

cHTMLFormElement()

cHTMLFormElement($name, $id, $disabled, $tabindex, $accesskey, $class) 
Inherited
inherited_from \cHTMLFormElement::cHTMLFormElement()
inherited_from \cHTMLTextbox::cHTMLFormElement()
inherited_from \cDatefield::cHTMLFormElement()

Parameters

$name

$id

$disabled

$tabindex

$accesskey

$class

cHTMLTextbox()

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

Parameters

$name

$initvalue

$width

$maxlength

$id

$disabled

$tabindex

$accesskey

Outputs the generated markup

display() 
Inherited
inherited_from \cHTML::display()
inherited_from \cHTMLFormElement::display()
inherited_from \cHTMLTextbox::display()
inherited_from \cDatefield::display()

Fills the close skeleton

fillCloseSkeleton() : string
Inherited
inherited_from \cHTML::fillCloseSkeleton()
inherited_from \cHTMLFormElement::fillCloseSkeleton()
inherited_from \cHTMLTextbox::fillCloseSkeleton()
inherited_from \cDatefield::fillCloseSkeleton()

Returns

stringfilled SGML closer skeleton

Fills the open SGML tag skeleton

fillSkeleton(string $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()
inherited_from \cDatefield::fillSkeleton()

Parameters

$attributes

string

Attributes to set

Returns

stringfilled SGML opener skeleton

Returns the value of the given attribute.

getAttribute(string $attributeName) : string
Inherited
inherited_from \cHTML::getAttribute()
inherited_from \cHTMLFormElement::getAttribute()
inherited_from \cHTMLTextbox::getAttribute()
inherited_from \cDatefield::getAttribute()

Parameters

$attributeName

string

Attribute name

Returns

stringnull value or null if the attribute does not exist

Returns the assoc array(default) or string of attributes

getAttributes(bool $returnAsString) : array
Inherited
inherited_from \cHTML::getAttributes()
inherited_from \cHTMLFormElement::getAttributes()
inherited_from \cHTMLTextbox::getAttributes()
inherited_from \cDatefield::getAttributes()

Parameters

$returnAsString

bool

Whether to return the attributes as string

Returns

arraystring

Returns the current ID

getID() : string
Inherited
inherited_from \cHTML::getID()
inherited_from \cHTMLFormElement::getID()
inherited_from \cHTMLTextbox::getID()
inherited_from \cDatefield::getID()

Returns

stringcurrent ID

Removes an attribute

removeAttribute(string $attributeName) : \cHTML
Inherited
inherited_from \cHTML::removeAttribute()
inherited_from \cHTMLFormElement::removeAttribute()
inherited_from \cHTMLTextbox::removeAttribute()
inherited_from \cDatefield::removeAttribute()

Parameters

$attributeName

string

Attribute name

Returns

\cHTML$this

Alias for toHtml

render() : string

Returns

stringGenerated markup

Sets the access key for this element.

setAccessKey(string $accesskey) : \cHTMLFormElement
Inherited
inherited_from \cHTMLFormElement::setAccessKey()
inherited_from \cHTMLTextbox::setAccessKey()
inherited_from \cDatefield::setAccessKey()

Parameters

$accesskey

string

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

Returns

Sets the alt and title attributes

setAlt(string $alt) : \cHTML
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()
inherited_from \cDatefield::setAlt()

Parameters

$alt

string

Text to set as the "alt" and "title" attribute

Returns

\cHTML$this

Sets a specific attribute

setAttribute(string $attributeName, string $value) : \cHTML
Inherited
inherited_from \cHTML::setAttribute()
inherited_from \cHTMLFormElement::setAttribute()
inherited_from \cHTMLTextbox::setAttribute()
inherited_from \cDatefield::setAttribute()

Parameters

$attributeName

string

Name of the attribute

$value

string

Value of the attribute

Returns

\cHTML$this

Sets the HTML attributes

setAttributes(array $attributes) : \cHTML
Inherited
inherited_from \cHTML::setAttributes()
inherited_from \cHTMLFormElement::setAttributes()
inherited_from \cHTMLTextbox::setAttributes()
inherited_from \cDatefield::setAttributes()

Parameters

$attributes

array

Associative array with attributes

Returns

\cHTML$this

Sets the CSS class

setClass(string $class) : \cHTML
Inherited
inherited_from \cHTML::setClass()
inherited_from \cHTMLFormElement::setClass()
inherited_from \cHTMLTextbox::setClass()
inherited_from \cDatefield::setClass()

Parameters

$class

string

Text to set as the "class" attribute

Returns

\cHTML$this

Contentless tag setter

setContentlessTag(bool $contentlessTag) : \cHTML
Inherited
inherited_from \cHTML::setContentlessTag()
inherited_from \cHTMLFormElement::setContentlessTag()
inherited_from \cHTMLTextbox::setContentlessTag()
inherited_from \cDatefield::setContentlessTag()

Parameters

$contentlessTag

bool

Returns

\cHTML$this

Sets the "disabled" attribute of an element.

setDisabled(string $disabled) : \cHTMLFormElement
Inherited

User Agents usually are showing the element as "greyed-out".

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()
inherited_from \cDatefield::setDisabled()

Parameters

$disabled

string

Sets the disabled-flag if non-empty

Returns

Adds an "on???" javascript event handler

setEvent(string $event, string $action) : \cHTML
Inherited

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

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

Parameters

$event

string

Type of the event, e. g. "change" for "onchange"

$action

string

Function or action to call (JavaScript Code)

Returns

\cHTML$this

Setter for static $_generateXHTML property

setGenerateXHTML(bool $value) 
InheritedStatic
inherited_from \cHTML::setGenerateXHTML()
inherited_from \cHTMLFormElement::setGenerateXHTML()
inherited_from \cHTMLTextbox::setGenerateXHTML()
inherited_from \cDatefield::setGenerateXHTML()

Parameters

$value

bool

Sets the ID class

setID(string $id) : \cHTML
Inherited
inherited_from \cHTML::setID()
inherited_from \cHTMLFormElement::setID()
inherited_from \cHTMLTextbox::setID()
inherited_from \cDatefield::setID()

Parameters

$id

string

Text to set as the "id"

Returns

\cHTML$this

Sets the maximum input length of the text box.

setMaxLength(int $maxlen) : \cHTMLTextbox
Inherited
inherited_from \cHTMLTextbox::setMaxLength()
inherited_from \cDatefield::setMaxLength()

Parameters

$maxlen

int

maximum input length

Returns

setReadOnly()

setReadOnly($bReadOnly) 

Parameters

$bReadOnly

setSelectsToHide()

setSelectsToHide($aSelectIDs) 

Parameters

$aSelectIDs

Sets the CSS style

setStyle(string $style) : \cHTML
Inherited
inherited_from \cHTML::setStyle()
inherited_from \cHTMLFormElement::setStyle()
inherited_from \cHTMLTextbox::setStyle()
inherited_from \cDatefield::setStyle()

Parameters

$style

string

Text to set as the "style" attribute

Returns

\cHTML$this

setStyleDefinition()

setStyleDefinition(string $entity, string $definition) : \cHTML
Inherited
inherited_from \cHTML::setStyleDefinition()
inherited_from \cHTMLFormElement::setStyleDefinition()
inherited_from \cHTMLTextbox::setStyleDefinition()
inherited_from \cDatefield::setStyleDefinition()

Parameters

$entity

string

Entity to define

$definition

string

Definition for the given entity

Returns

\cHTML$this

Sets the tab index for this element.

setTabindex(int $tabindex) : \cHTMLFormElement
Inherited

The tab index needs to be numeric, bigger than 0 and smaller than 32767.

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

Parameters

$tabindex

int

Desired tab index

Returns

Sets the HTML tag to $tag

setTag(string $tag) : \cHTML
Inherited
inherited_from \cHTML::setTag()
inherited_from \cHTMLFormElement::setTag()
inherited_from \cHTMLTextbox::setTag()
inherited_from \cDatefield::setTag()

Parameters

$tag

string

The new tag

Returns

\cHTML$this

Sets the initial value of the text box.

setValue(string $value) : \cHTMLTextbox
Inherited
inherited_from \cHTMLTextbox::setValue()
inherited_from \cDatefield::setValue()

Parameters

$value

string

Initial value

Returns

Sets the width of the text box.

setWidth(int $width) : \cHTMLTextbox
Inherited
inherited_from \cHTMLTextbox::setWidth()
inherited_from \cDatefield::setWidth()

Parameters

$width

int

width of the text box

Returns

Generates the markup of the element

toHTML() : string
Inherited
inherited_from \cHTML::toHTML()
inherited_from \cHTMLFormElement::toHTML()
inherited_from \cHTMLTextbox::toHTML()
inherited_from \cDatefield::toHTML()

Returns

stringGenerated markup

Removes an event handler

unsetEvent(string $event) : \cHTML
Inherited

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

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

Parameters

$event

string

Type of the event

Returns

\cHTML$this

Updates the passed attribute without changing the other existing attributes

updateAttribute(string $name, string $value) : \cHTML
Inherited
inherited_from \cHTML::updateAttribute()
inherited_from \cHTMLFormElement::updateAttribute()
inherited_from \cHTMLTextbox::updateAttribute()
inherited_from \cDatefield::updateAttribute()

Parameters

$name

string

the name of the attribute

$value

string

the value of the attribute with the given name

Returns

\cHTML$this

Updates the passed attributes without changing the other existing attributes

updateAttributes(array $attributes) : \cHTML
Inherited
inherited_from \cHTML::updateAttributes()
inherited_from \cHTMLFormElement::updateAttributes()
inherited_from \cHTMLTextbox::updateAttributes()
inherited_from \cDatefield::updateAttributes()

Parameters

$attributes

array

Associative array with attributes

Returns

\cHTML$this

Adds the given content to the already existing content of this object.

_appendContent(string | object | array $content) : \cHTML
Inherited
inherited_from \cHTML::_appendContent()
inherited_from \cHTMLFormElement::_appendContent()
inherited_from \cHTMLTextbox::_appendContent()
inherited_from \cDatefield::_appendContent()

Parameters

$content

stringobjectarray

String with the content or an object to render or an array of strings/objects.

Returns

\cHTML$this

Returns an HTML formatted attribute string

_getAttrString(array $attributes) : string
Inherited
inherited_from \cHTML::_getAttrString()
inherited_from \cHTMLFormElement::_getAttrString()
inherited_from \cHTMLTextbox::_getAttrString()
inherited_from \cDatefield::_getAttrString()

Parameters

$attributes

array

Associative array with attributes

Returns

stringAttribute string in HTML format

Returns a valid atrributes array.

_parseAttributes(array $attributes) : array
Inherited
inherited_from \cHTML::_parseAttributes()
inherited_from \cHTMLFormElement::_parseAttributes()
inherited_from \cHTMLTextbox::_parseAttributes()
inherited_from \cDatefield::_parseAttributes()

Parameters

$attributes

array

Associative array with attributes

Returns

arraythe parsed attributes

Sets the content of the object

_setContent(string | object | array $content) : \cHTML
Inherited
inherited_from \cHTML::_setContent()
inherited_from \cHTMLFormElement::_setContent()
inherited_from \cHTMLTextbox::_setContent()
inherited_from \cDatefield::_setContent()

Parameters

$content

stringobjectarray

String with the content or a cHTML object to render or an array of strings / objects.

Returns

\cHTML$this

 Properties

 

$_oButton 
 

$_oCalendar 
 

$_oDate 
Inherited
inherited_from \cDatefield::$$_oDate
 

$_oImage 
 

$_attributes : array
Inherited
inherited_from \cHTML::$$_attributes
inherited_from \cHTMLFormElement::$$_attributes
inherited_from \cHTMLTextbox::$$_attributes
inherited_from \cDatefield::$$_attributes
 

$_content : string
Inherited
inherited_from \cHTML::$$_content
inherited_from \cHTMLFormElement::$$_content
inherited_from \cHTMLTextbox::$$_content
inherited_from \cDatefield::$$_content
 

$_contentlessTag : bool
Inherited
inherited_from \cHTML::$$_contentlessTag
inherited_from \cHTMLFormElement::$$_contentlessTag
inherited_from \cHTMLTextbox::$$_contentlessTag
inherited_from \cDatefield::$$_contentlessTag
 

$_eventDefinitions : array
Inherited
inherited_from \cHTML::$$_eventDefinitions
inherited_from \cHTMLFormElement::$$_eventDefinitions
inherited_from \cHTMLTextbox::$$_eventDefinitions
inherited_from \cDatefield::$$_eventDefinitions
 

$_generateXHTML : bool
Inherited
inherited_from \cHTML::$$_generateXHTML
inherited_from \cHTMLFormElement::$$_generateXHTML
inherited_from \cHTMLTextbox::$$_generateXHTML
inherited_from \cDatefield::$$_generateXHTML
 

$_idCounter : int
Inherited
inherited_from \cHTML::$$_idCounter
inherited_from \cHTMLFormElement::$$_idCounter
inherited_from \cHTMLTextbox::$$_idCounter
inherited_from \cDatefield::$$_idCounter
 

$_requiredScripts : array
Inherited
inherited_from \cHTML::$$_requiredScripts
inherited_from \cHTMLFormElement::$$_requiredScripts
inherited_from \cHTMLTextbox::$$_requiredScripts
inherited_from \cDatefield::$$_requiredScripts
 

$_skeletonClose : string
Inherited
inherited_from \cHTML::$$_skeletonClose
inherited_from \cHTMLFormElement::$$_skeletonClose
inherited_from \cHTMLTextbox::$$_skeletonClose
inherited_from \cDatefield::$$_skeletonClose
 

$_skeletonOpen : string
Inherited
inherited_from \cHTML::$$_skeletonOpen
inherited_from \cHTMLFormElement::$$_skeletonOpen
inherited_from \cHTMLTextbox::$$_skeletonOpen
inherited_from \cDatefield::$$_skeletonOpen
 

$_skeletonSingle : string
Inherited
inherited_from \cHTML::$$_skeletonSingle
inherited_from \cHTMLFormElement::$$_skeletonSingle
inherited_from \cHTMLTextbox::$$_skeletonSingle
inherited_from \cDatefield::$$_skeletonSingle
 

$_styleDefinitions : array
Inherited
inherited_from \cHTML::$$_styleDefinitions
inherited_from \cHTMLFormElement::$$_styleDefinitions
inherited_from \cHTMLTextbox::$$_styleDefinitions
inherited_from \cDatefield::$$_styleDefinitions
 

$_styleDefs : array
Inherited
inherited_from \cHTML::$$_styleDefs
inherited_from \cHTMLFormElement::$$_styleDefs
inherited_from \cHTMLTextbox::$$_styleDefs
inherited_from \cDatefield::$$_styleDefs
 

$_tag : string
Inherited
inherited_from \cHTML::$$_tag
inherited_from \cHTMLFormElement::$$_tag
inherited_from \cHTMLTextbox::$$_tag
inherited_from \cDatefield::$$_tag