Joomla XML Standard Field Type – Tel

Standard field type Joomla XML – Tel displays a plain text field that checks the completed information for the correct phone number.

This field looks like this:

The field code from the image looks like this:

<field name="tel" type="tel" label="Телефон" description="Описание поля"/>
Code language: YAML (yaml)

This field supports attributes:

  • name – the system name of the field.
  • type – the type of the field, in this case «tel».
  • 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.
  • spellcheck – tells the browser to check the grammar in the field. Possible values are true or false.

Leave a Reply