?
avatar nilesh-more
nilesh-more
15 May 2017

1. Summary of Changes

  • HTML5 is designed with extensibility in mind for data that should be associated with a particular element but need not have any defined meaning. data-* attributes allow us to store extra information on the standard, semantic HTML elements without other hacks such as non-standard attributes, extra properties on DOM.

  • However, custom attributes have no special meaning generally and are only special to the owner's application. They can be used to simplify an application's logic. By allowing JForm to support data attributes, it can be greatly aid development of extensions both core and third party.

2. Testing Instructions

  • Add data attribute in XML form, for example

    • Open administrator/components/com_users/models/forms/user.xml file
    • Add data attribute in xml field, like
       <field name="name" 
              type="text"
              description="COM_USERS_USER_FIELD_NAME_DESC"
              label="COM_USERS_USER_FIELD_NAME_LABEL"
      	required="true"
              size="30"
              data-action-type="click"  // add data attribute like this
         />
        
  • Login into administrator

  • Click on menu Users => Manage => Add New User

  • Inspect the filed = Name

    • Output should be like this
       <input type="text" 
              name="jform[name]" 
              id="jform_name" 
              value="" 
              class="required invalid" 
              size="30" 
              required="required" 
              aria-required="true" 
              data-action-type="click"  // output 
              autocomplete="off" 
              aria-invalid="true"
         />
           
    • Output snapshot
      screenshot from 2017-05-15 19 27 38
avatar nilesh-more nilesh-more - open - 15 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 15 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 15 May 2017
Category com_fields
avatar parthlawate
parthlawate - comment - 17 May 2017

Should be helpful to get this done.. Can you explain a few use cases of how a developer can leverage this ?

avatar franz-wohlkoenig franz-wohlkoenig - change - 17 May 2017
Status New Information Required
avatar brianteeman
brianteeman - comment - 20 May 2017

Closed as we have a pr for testing see #16141

avatar brianteeman brianteeman - change - 20 May 2017
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2017-05-20 12:10:02
Closed_By brianteeman
avatar brianteeman brianteeman - close - 20 May 2017
avatar bettyorganero
bettyorganero - comment - 4 Apr 2018

Hello, I want to ask you if this issue is solved on the version 3.8.6.
Thank you

avatar Quy
Quy - comment - 4 Apr 2018

No. Please test #16141 and report your result.

Add a Comment

Login with GitHub to post a comment