{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/16141","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/16141/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/16141/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/16141/events","html_url":"https://github.com/joomla/joomla-cms/pull/16141","id":230149308,"number":16141,"title":"Issue #16034 feat: Allow jForm to support data attribute","user":{"login":"nilesh-more","id":16605829,"avatar_url":"https://avatars2.githubusercontent.com/u/16605829?v=4","gravatar_id":"","url":"https://api.github.com/users/nilesh-more","html_url":"https://github.com/nilesh-more","followers_url":"https://api.github.com/users/nilesh-more/followers","following_url":"https://api.github.com/users/nilesh-more/following{/other_user}","gists_url":"https://api.github.com/users/nilesh-more/gists{/gist_id}","starred_url":"https://api.github.com/users/nilesh-more/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilesh-more/subscriptions","organizations_url":"https://api.github.com/users/nilesh-more/orgs","repos_url":"https://api.github.com/users/nilesh-more/repos","events_url":"https://api.github.com/users/nilesh-more/events{/privacy}","received_events_url":"https://api.github.com/users/nilesh-more/received_events","type":"User","site_admin":false},"labels":[{"id":60721348,"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":25,"created_at":"2017-05-20T12:00:23Z","updated_at":"2018-04-20T10:44:46Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/16141","html_url":"https://github.com/joomla/joomla-cms/pull/16141","diff_url":"https://github.com/joomla/joomla-cms/pull/16141.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/16141.patch"},"body":"Pull Request for Issue #16034 \r\n\r\n### Summary of Changes\r\n- [HTML5](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/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.\r\n\r\n- 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.\r\n\r\n### Testing Instructions\r\n-  Add data attribute in XML form, for example\r\n     -  Open administrator/components/com_users/models/forms/user.xml file\r\n     -   Add data attribute in xml field, like\r\n          <pre><code> &lt;field name=\"name\" \r\n                 type=\"text\"\r\n\t             description=\"COM_USERS_USER_FIELD_NAME_DESC\"\r\n\t             label=\"COM_USERS_USER_FIELD_NAME_LABEL\"\r\n         \trequired=\"true\"\r\n                 size=\"30\"\r\n                 data-action-type=\"click\"  // add data attribute like this\r\n            /&gt;\r\n           </code ></pre>\r\n\r\n- Login into administrator\r\n- Click on menu Users => Manage => Add New User\r\n- Inspect the filed = *Name* and check input type html\r\n\r\n### Expected result\r\n  * Output should be like this \r\n      <pre><code> &lt;input type=\"text\" \r\n            name=\"jform[name]\" \r\n            id=\"jform_name\" \r\n            value=\"\" \r\n            class=\"required invalid\" \r\n            size=\"30\" \r\n            required=\"required\" \r\n            aria-required=\"true\" \r\n            data-action-type=\"click\"  // output \r\n            autocomplete=\"off\" \r\n            aria-invalid=\"true\"\r\n       /&gt;\r\n         </code ></pre>\r\n   * Output snapshot\r\n![screenshot from 2017-05-15 19 27 38](https://cloud.githubusercontent.com/assets/16605829/26061183/cf507526-39a4-11e7-8aa9-a7a562a006db.png)\r\n\r\n### Actual result\r\n\r\n* Added data attribute is missing in final output\r\n      <pre><code> &lt;input type=\"text\" \r\n                      name=\"jform[name]\" \r\n                      id=\"jform_name\" \r\n                      value=\"\" \r\n                      class=\"required invalid\" \r\n                      size=\"30\" \r\n                      required=\"required\" \r\n                     aria-required=\"true\" \r\n                     autocomplete=\"off\" \r\n                     aria-invalid=\"true\"\r\n       /&gt;\r\n         </code ></pre>\r\n\r\n\r\n### Documentation Changes Required\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/383058731","html_url":"https://github.com/joomla/joomla-cms/pull/16141#issuecomment-383058731","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/16141","id":383058731,"user":{"login":"nilesh-more","id":16605829,"avatar_url":"https://avatars2.githubusercontent.com/u/16605829?v=4","gravatar_id":"","url":"https://api.github.com/users/nilesh-more","html_url":"https://github.com/nilesh-more","followers_url":"https://api.github.com/users/nilesh-more/followers","following_url":"https://api.github.com/users/nilesh-more/following{/other_user}","gists_url":"https://api.github.com/users/nilesh-more/gists{/gist_id}","starred_url":"https://api.github.com/users/nilesh-more/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilesh-more/subscriptions","organizations_url":"https://api.github.com/users/nilesh-more/orgs","repos_url":"https://api.github.com/users/nilesh-more/repos","events_url":"https://api.github.com/users/nilesh-more/events{/privacy}","received_events_url":"https://api.github.com/users/nilesh-more/received_events","type":"User","site_admin":false},"created_at":"2018-04-20T10:44:46Z","updated_at":"2018-04-20T10:44:46Z","author_association":"CONTRIBUTOR","body":"@bettyorganero \r\n\r\nData attributes are used to simplify an application logic they have no special meaning generally. It can be used to allow developers to store extra information - it can be '0', 'true', '(function(){ some random code})()',"}}
{"actor":{"display_login":"nilesh-more"}}