I will assume, since you are reading this article, you already have a reason for wanting to hide your Gravity Forms Product field. The reasons are many and varied. My first recommendation?
Use the “Hidden” Product Field Type
This will create a truly hidden input. This is the simplest approach and works well for simple products.
Working with Hidden Fields can be tricky. There’s no easy way to confirm the Hidden field contains the expected value. Now you can! GP Live Preview provides a super easy way to see your hidden fields when previewing your form.
Use the “gf_invisible” CSS Class
The “gf_invisible” CSS class will hide any field from view (using a different technique than the “gf_hidden” class; more on that below). This allows you to use any product field type for your product field and still prevent the field from being visible to the user.
What about the “gf_hidden” CSS class?
If you’re already familiar with the more common “gf_hidden” CSS class, you might be wondering why not use this class instead? The “gf_hidden” class uses “display: none;” to hide the field. Gravity Forms won’t include products (or options, or shipping fees) with the “display: none;” style declaration in the form total.
If you’re already familiar with the more common “gf_hidden” CSS class, you might be wondering why not use this class instead? The “gf_hidden” class uses “display: none;” to hide the field. Gravity Forms won’t include products (or options, or shipping fees) with the “display: none;” style declaration in the form total.