The text form field type provides a text box for data entry. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.

Example XML field definition:

<field name="mytextvalue" 
type="text"
default="Some text"
label="Enter some text"
description=""
size="10" />

Use the integer filter to ensure that letters types get stripped when the form is processed.

<field name="myintvalue" 
type="text"
default=""
label="Enter some text"
description="Enter some description"
filter="integer" />

Use the raw filter to ensure that html code is preserved when the form is processed.

<field name="myhtmlvalue" 
type="text"
default=""
label="Enter some text"
description="Enter some description"
filter="raw" />

Mandatory Parameters

  • type must be text.

  • name is the unique name of the field.

  • label (translatable) is the descriptive title of the field.

Optional Parameters

  • size is the width of the text box in characters.

  • maxlength limits the number of characters that may be entered.

  • default (not translatable) is the default value.

  • description (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

  • class - CSS class name for the HTML form field.

  • readonly - The field cannot be changed and will automatically inherit the default value

  • disabled - The field cannot be changed and will automatically inherit the default value - it will also not submit

  • required - The field must be filled before submitting the form.

  • filter - Allow the system to save certain html tags or raw data.

  • message - The error message that will be displayed instead of the default message.

  • hint - The text displayed in the html placeholder element, usually a lighter coloured hint displayed inside an blank field.