IText
From FiFormsWiki
class iText extends iInput
The class creates a simple, data-bound text input on a form. It is represented by the <iText /> element in FiForms XML.
Contents |
XML Representation
The iText element and attributes are documented at http://xml.fiforms.org/schema/11/doc/FiForm.html#element_iText
The element is typically empty, but can contain <loaddata /> and <depends /> elements for dynamically filling the data from the server using AJAX.
The following example is a typical representation of iText in an XML form definition:
<iText field="FIRST_NAME" caption="Addressee's First Name" size="40" />
Some of the most relevant attributes of this element include:
- field: The name of the field in the database
- caption: The field label on the form
- size: Width of the field, in characters
- default: default value
- formatexp: Regular Expression used to validate input
- readonly: Makes the field read-only if this attribute is set to "readonly"
Class Properties
| $size | The size of the text input, echoed to the output as size="%size%". Default is 20. |
| $type | The type of text input. This is simply echoed to the output as type="%type%". Default is "text". |
Properties inherited from iInput: $caption $currentRec $dbField $error $errorMsg $formatStr $formatStrRO $otherTags $readOnly $section $value $valueToSave
Method Detail
Methods inherited from iInput
- checkRO
- drawInput
- getValueToSave
- hide
- iInput
- throwError
iText
Constructs a new iText object.
Syntax: iText($dbField,$caption)
Parameters
$dbField - Name of bound database field
$caption - (optional) Field caption. If omitted, set to the dbField name.
Examples
Example
Declaring a simple iText on a form
$frm->inputs[] = new iText('FName','First Name');
Returns
A new iText object

