{"id":13684606,"url":"https://github.com/growella/gravityforms-autocomplete-fields","last_synced_at":"2025-05-01T00:32:15.429Z","repository":{"id":18229057,"uuid":"82333136","full_name":"growella/gravityforms-autocomplete-fields","owner":"growella","description":"Extension for Gravity Forms that enables `autocomplete` attributes to be assigned to form fields.","archived":false,"fork":false,"pushed_at":"2023-09-07T18:17:02.000Z","size":84,"stargazers_count":23,"open_issues_count":6,"forks_count":3,"subscribers_count":7,"default_branch":"develop","last_synced_at":"2024-08-03T14:07:50.048Z","etag":null,"topics":["autocomplete","gravity-forms","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/growella.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-17T19:58:07.000Z","updated_at":"2023-12-01T07:18:54.000Z","dependencies_parsed_at":"2022-07-23T01:16:09.541Z","dependency_job_id":null,"html_url":"https://github.com/growella/gravityforms-autocomplete-fields","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/growella%2Fgravityforms-autocomplete-fields","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/growella%2Fgravityforms-autocomplete-fields/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/growella%2Fgravityforms-autocomplete-fields/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/growella%2Fgravityforms-autocomplete-fields/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/growella","download_url":"https://codeload.github.com/growella/gravityforms-autocomplete-fields/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224230569,"owners_count":17277372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocomplete","gravity-forms","wordpress","wordpress-plugin"],"created_at":"2024-08-02T14:00:35.510Z","updated_at":"2024-11-12T06:30:22.032Z","avatar_url":"https://github.com/growella.png","language":"PHP","readme":"# Gravity Forms: Autocomplete Fields\n\n[![Build Status](https://travis-ci.org/growella/gravityforms-autocomplete-fields.svg?branch=develop)](https://travis-ci.org/growella/gravityforms-autocomplete-fields)\n[![Code Climate](https://codeclimate.com/github/growella/gravityforms-autocomplete-fields/badges/gpa.svg)](https://codeclimate.com/github/growella/gravityforms-autocomplete-fields)\n[![Test Coverage](https://codeclimate.com/github/growella/gravityforms-autocomplete-fields/badges/coverage.svg)](https://codeclimate.com/github/growella/gravityforms-autocomplete-fields/coverage)\n\n\u003e **Note:** This plugin is still early in its development lifecycle, and it's not recommended for use in a production environment [until it hits its first release](https://github.com/growella/gravityforms-autocomplete-fields/releases).\n\n\nThe Gravity Forms: Autocomplete Fields adds support for [the HTML5 `autocomplete` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autocomplete) to Gravity Forms' fields.\n\nThe `autocomplete` attribute is an HTML5 standard used to assist browsers auto-fill user data by disambiguating the form fields. By explicitly assigning these attributes to Gravity Forms fields, we can help improve the user experience when completing forms.\n\n```html\n\u003cform\u003e\n\t\u003c!-- Hints that \"fname\" is the user's given (first) name --\u003e\n\t\u003clabel for=\"first-name\"\u003eFirst Name\u003c/label\u003e\n\t\u003cinput name=\"fname\" id=\"first-name\" autocomplete=\"given-name\" /\u003e\n\n\t\u003c!-- Helps autocomplete the postal code --\u003e\n\t\u003clabel for=\"zip\"\u003eZIP Code\u003c/label\u003e\n\t\u003cinput name=\"zip\" id=\"zip\" autocomplete=\"postal-code\" /\u003e\n\u003c/form\u003e\n```\n\nIf the `autocomplete` property is new to you, [Cloud Four has a great writeup about use-cases and implementation](https://cloudfour.com/thinks/autofill-what-web-devs-should-know-but-dont/).\n\n\n## Installation\n\nTo install this add-on, either clone or download a zip of the repository and add it to your WordPress installation's `wp-content/plugins/` folder. Once in-place, activate the plugin through the \"Plugins\" screen in the WordPress administration tool.\n\nPlease note that this plugin requires [Gravity Forms](http://www.gravityforms.com/) and PHP version 5.3 or higher.\n\n\n## Usage\n\nUpon activation, the plugin will add \"Autocomplete Attribute\" settings to every Gravity Forms field type, under the \"Advanced\" tab.\n\n![Gravity Forms field settings with the \"Autocomplete Attribute\"](screenshots/screenshot-1.png)\n\nSelecting a value here will inject the corresponding `autocomplete` attribute when the form is rendered.\n\n\n## Filter reference\n\nGravity Forms: Autocomplete Fields offers a few filters that can be used to further customize the plugin's functionality.\n\n\n### gform_autocomplete_attribute\n\nThis filter is called immediately before the `autocomplete` attribute is injected into an input. Use this filter if you need to further customize the attribute to [include any detail tokens like \"section-\", \"shipping\", etc.](https://html.spec.whatwg.org/multipage/forms.html#autofill-detail-tokens)\n\nType | Variable | Description\n---- | -------- | -----------\nstring | `$attribute` | The current `autocomplete` attribute value.\nGF_Field | `$field` | The current Gravity Forms field object.\n\n#### Example\n\nIn this example, we're checking the `$field['cssClass']` for the class of \"shipping\" and, if it's found, we're prepending the `shipping` detail token to the autocomplete attribute value.\n\n```php\n/**\n * If an address input has class 'shipping', add 'shipping' to the autocomplete attribute.\n *\n * @param string   $attribute The autocomplete attribute for this input.\n * @param GF_Field $field     The Gravity Forms field object.\n * @return string The possibly-modified $attribute string.\n */\nfunction mytheme_inject_shipping_autocomplete_token( $attribute, $field ) {\n\tif ( in_array( 'shipping', explode( ' ', $field['cssClass'] ), true ) ) {\n\t\t$attribute = 'shipping ' . $attribute;\n\t}\n\n\treturn $attribute;\n}\nadd_filter( 'gform_autocomplete_attribute', 'mytheme_inject_shipping_autocomplete_token', 10, 2 );\n```\n","funding_links":[],"categories":["Third-Party Add-Ons"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrowella%2Fgravityforms-autocomplete-fields","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrowella%2Fgravityforms-autocomplete-fields","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrowella%2Fgravityforms-autocomplete-fields/lists"}