How to Add Custom Attributes for Joomla Form Fields
Joomla is indeed a great CMS with great features and flexibility. Sometimes it does not have native API support for some specific functions that we need badly but due to the flexibility of Joomla, allow us to implement what we want without hazard.
Fortunately, Joomla provides us the ability to override anything of it’s API. So I just overrode the form fields definition by simply copying text.php (I needed to setup tab index to text fields only) from Site Root \ libraries\joomla\form\fields to My component\models\fields directory.Then I can simply add field definition to XML file like this.
here is the overrode field definition.
That’s it, folks. That’s how you create a custom attribute for Joomla standard form field.