這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Gravity Forms Placeholder Add-On

描述

NOTE
The plugin is based off of the placeholder support add-on initially developed by neojp and can be found at the link below. The main
difference being that we added support for drop-down fields.
https://wordpress.org/plugins/gravity-forms-placeholders/

This plugin gives support for placeholders to the Gravity Forms WordPress Plugin.

In order to use the plugin you need only add the class of \”gf-add-placeholder\” to any of the fields you wish to have a placeholder on.

The plugin will take the text of the label and then hide said label and apply the text from the label to the placeholder attribute.

If you would like to to use this on your entire form then you need only add the \”gf-add-placeholder\” class to the form itself and then it will be applied to all the form elements.

DROPDOWN FIELDS

As im sure you know, the select field in HTML does not have a native placeholder attribute. Now you can do what some do and just add an option that says \”please select\” but that is not (in my opinion) the best way.

This plugin does the following to give a placeholder LIKE support to the select fields

It takes and hides the label just like it does with the other fields but then it takes the text from that label and prepends an option to the select field that contains the text from the label as it\’s value and it also adds a selected and disabled attribute to the option. Ensuring that it is selected and also ensuring that once a user clicks into the field that they wont be able to select and submit with that option.

In the future i fully intend on adding features that will allow the hiding of labels to be optional and the feature for you to be able to manually set your placeholder text as opposed to it just pulling in the label text.

The plugin requires Javascript and Jquery to function and is tested up to WordPress version 3.8.1 and Gravity Forms Version 1.8

ENJOY! and happy coding 🙂

安裝

To install upload the folder placeholder-for-gravity-forms to the wp-content/plugins folder then login to your dashboard and activate the plugin.

常見問題

Installation Instructions

To install upload the folder placeholder-for-gravity-forms to the wp-content/plugins folder then login to your dashboard and activate the plugin.

評價

閱讀全部12個評價

貢獻者及開發者

“Gravity Forms Placeholder Add-On” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

修改日誌

1.1.0
Moved the call for the jquery to the footer
Binded the call to the placeholder function to the gform_post_render so that it will reinitialize on form errors.