Common Properties of Joomla Form Field

There are many common properties that are used to define XML form fields in Joomla. Additionally, there are properties specific to field type.

Mandatory Parameters

1. type: Type of the field. For example - text, textarea, list, calendar

2. name: This is the unique name of the field.

3. label: (translatable) This is the descriptive title of the field.

Optional Parameters

4. description: (translatable) This is the help text for the field.

5. default: (not translatable) This is the default value for the field.

6. class: CSS class to style the form control (like input, select) of the field. For example: form-control-sm

7. labelclass: CSS class that is applied to the label of the field. For example: fw-bold 

8. parentclass: CSS class that is applied to form field element that contains both label and form control. 

9. readonly: The readonly state for the form field. If true, then the field will be readonly. The field cannot be changed and will automatically inherit the default value.

10. disabled: The disabled state for the form field.  If true, then the field will be disabled and user can't interact with the field. The field cannot be changed and will automatically inherit the default value. It will also not submit.

11. required: The required state for the form field.  If true then there must be a value for the field to be considered valid. The field must be filled before submitting the form.

12. filter: Allow the system to save certain html tags or raw data.

13. message: The error message that will be displayed instead of the default message.

14. hint: (translatable) The text displayed in the html placeholder element, usually a lighter coloured hint displayed inside a blank field.

15. pattern: A regular expression pattern for field validation. For example, to input three letter country code: [A-Z]{3}

16. validationtext: The validation text of invalid pattern value of the form field.

17. hiddenLabel: Set to true to hide the label of the field on the form. The default value is false.

18. hiddenDescription: Set to true to hide the description of the field on the form. The default value is false.

19. spellcheck: The spellcheck state for the form field. The default value is true.

20. autocomplete: The autocomplete state for the form field.  If 'off' element will not be automatically completed by browser. The default value is on.

21. autofocus: The autofocus request for the form field.  If true element will be automatically focused on document load. The default value is false.

22. showon: The conditions to show/hide the field.