With Gravity Forms, WordPress form builder plugin, version 1.9, they added the ability to use placeholders. Giving you the option to display field labels or just use the placeholder.
I love this feature because I can use less space with my forms, and make the design cooler!
What are Placeholders and Labels
As depicted below, the red circles indicate Placeholders and the green squares are field labels. So placeholders are the text inside the actual filed that disappears when you click in the field to start typing.
How to add a Placeholder
Adding placeholders is simple, when editing the field go to the “Appearance” tab and the first option is “Placeholders”.
Just populate the field with the text you want to display.
How do I only using Placeholders?
This was the tricky part. In version 1.9.1 they decided to hide the options that allow you to hide the field labels and sub labels.
These are your default options:
Why they did this, I have no idea! It doesn’t really make sense to me, but thankfully you can override the default with one line of code you add to your themes functions.php page.
These are your options after adding the code:
When you select “Hidden”, the field label is removed from the the form. You can also hide the Sub-Labels as well, for the fields that support sub-labels.
Below is the updated from with field labels removed from all fields.
This is the one line of code you need to add to your functions.php theme file to allow you to hide field labels.
Just copy and past it into your functions.php file on it’s own line.
That’s it! Add that one string of code and you’ll have the ability to control field labels and take full advantage of Gravity Forms Placeholders!
Question? Need help? Use the comments below!