Form checkbox
string
addCheckBox
(string $sName, [boolean $bChecked = false], [string $sValue = null], [array $aAttribs = array()])
-
string
$sName: field name
-
boolean
$bChecked: controls if field is checked
-
string
$sValue
-
array
$aAttribs: (since 1.5.1) extra attributes
Make a <form> start-tag.
string
addForm
(string $sAction, [string $sMethod = 'post'], [string $sName = ''], [string $sEnctype = ''], [string $sCharset = ''], [array $aAttribs = array()])
-
string
$sAction: form handler URL
-
string
$sMethod: http method used to submit form data. 'get' or 'post'
-
string
$sName: form name used for identification (used for backward compatibility). Use of id is recommended.
-
string
$sEnctype: content type that is used to submit data. html 4.01 defaults to 'application/x-www-form-urlencoded'. Form with file field needs 'multipart/form-data' encoding type.
-
string
$sCharset: charset that is used for submitted data
-
array
$aAttribs: (since 1.5.1) extra attributes
A hidden form field.
html
addHidden
(string $sName, string $sValue, [array $aAttribs = array()])
-
string
$sName: field name
-
string
$sValue: field value
-
array
$aAttribs: (since 1.5.1) extra attributes
An input textbox.
string
addInput
(string $sName, [string $sValue = ''], [integer $iSize = 0], [integer $iMaxlength = 0], [array $aAttribs = array()])
-
string
$sName: field name
-
string
$sValue: initial field value
-
integer
$iSize: field size (number of characters)
-
integer
$iMaxlength: maximum number of characters the user may enter
-
array
$aAttribs: (since 1.5.1) extra attributes - should be given in the form array('attribute_name' => 'attribute_value', ...)
Helper function to create form fields, not to be called directly, only by other functions below.
Function used different syntax before 1.5.1
string
addInputField
(string $sType, [array $aAttribs = array()])
-
string
$sType: type of input field. Possible values (html 4.01 specs.): text, password, checkbox, radio, submit, reset, file, hidden, image, button.
-
array
$aAttribs: (since 1.5.1) extra attributes. Array key is attribute name, array value is attribute value. Array keys must use lowercase.
Password input field
string
addPwField
(string $sName, [string $sValue = null], [array $aAttribs = array()])
-
string
$sName: field name
-
string
$sValue: initial password value
-
array
$aAttribs: (since 1.5.1) extra attributes
Form radio box
string
addRadioBox
(string $sName, [boolean $bChecked = false], [string $sValue = null], [array $aAttribs = array()])
-
string
$sName: field name
-
boolean
$bChecked: controls if field is selected
-
string
$sValue
-
array
$aAttribs: (since 1.5.1) extra attributes.
Form reset button
string
addReset
(string $sValue, [array $aAttribs = array()])
-
string
$sValue: button name
-
array
$aAttribs: (since 1.5.1) extra attributes
Function to create a selectlist from an array.
string
addSelect
(string $sName, array $aValues, [mixed $default = null], [boolean $bUsekeys = false], [array $aAttribs = array()])
-
string
$sName: field name
-
array
$aValues: field values array ( key => value ) -> <option value="key">value</option>
-
mixed
$default: the key that will be selected
-
boolean
$bUsekeys: use the keys of the array as option value or not
-
array
$aAttribs: (since 1.5.1) extra attributes
Form submission button
Note the switched value/name parameters!
string
addSubmit
(string $sValue, [string $sName = null], [array $aAttribs = array()])
-
string
$sValue: button name
-
string
$sName: submitted key name
-
array
$aAttribs: (since 1.5.1) extra attributes
Textarea form element.
string
addTextArea
(string $sName, [string $sText = ''], [integer $iCols = 40], [integer $iRows = 10], [array $aAttribs = array()])
-
string
$sName: field name
-
string
$sText: initial field value
-
integer
$iCols: field width (number of chars)
-
integer
$iRows: field height (number of character rows)
-
array
$aAttribs: (since 1.5.1) extra attributes. function accepts string argument for backward compatibility.