Joomla XML Standard Field Type – Text

Standard field type Joomla XML – Text displays a regular one-line text box.

It looks like this:

The field code from the image looks like this:

<field name="text" type="text" default="Стандартное значение" description="Описание поля" label="Текстовое поле"/>
Code language: YAML (yaml)

This field supports attributes:

  • name – the system name of the field.
  • type – the type of the field, in this case «text».
  • label – the display name of the field.
  • description – the displayed field description. In Joomla 3, it is displayed as a tooltip when hovering over a field name.
  • class – applied CSS field classes.
  • default – sets the default value of the field.
  • required – sets the attribute of a required field. Possible choices are true and false.
  • onchange – allows you to add a Java Script field handler when the data in it changes.
  • readonly – sets the field to read-only mode, the field value cannot be changed. The options can be true and false.
  • maxlength – sets the maximum number of characters entered.
  • size – the width of the field, which is specified by the number of characters.
  • disabled – makes the field unavailable. The options can be true and false.

There are several more attributes available in Joomla 3:

  • hint – adds a placeholder to the field.
  • autocomplete – disables auto-fill for the field. To disable you need to specify a value for example autocomplete=”off”. To make autocomplete available, simply remove this attribute.
  • autofocus – sets autofocus to field after page load.
  • filter – sets the option for filtering data in the field.
  • message – the text of the error message, which will be replaced by the standard error text.
  • inputtype – sets the HTML5 input type.
  • pattern – a regular expression pattern to use when validating data.

For now, that’s all there is to it about the Joomla XML field type – Text. If we receive new information, it will be added to this article.

Do you need help generating an XML file? Write to us at admin@iws.by and we will help you.

Leave a Reply