Share: Gravity Forms: How to a Hide Gravity Forms Product Field and Total
Gravity Forms is by far our favorite plugin! Yes, it for creating forms but it can do so many things that it is one of the best tools any WordPress user can use. We have created basic contact forms to property applications, and a quote builder with hundreds of variations and calculations. This is why we are sharing this info below!
Want to hide a field in Gravity Forms but still have it count towards the overall total of the form? Typically when you want to have a hidden field in Gravity Forms you would use the Hidden field from the Standard set of fields available, as shown below. The Hidden field can be used to store information that should be not visible to the user but can be processed and stored with the user submission.
In our case, we needed to hide the Total, and a few pricing options from the Pricing Fields to make a calculation that we did not want the user to see but we did want to grab this value for our sales teams to review.
We tried hiding the field wit the “gf_hidden” CSS class which uses “display:none;” to hide the field but Gravity Forms won’t include the products (or options, or shipping fees) with the “display:none;” style declaration in the form. [Source: Gravity Wiz]
Instead, we used the “gf_invisible” CSS class. In Gravity Forms v 1.9.5 [here] they released a CSS class called “gf_invisible” for use when you need to hide a product field that should not be visible to the user / customer but should count towards the total price for further calculations which worked perfect for our quote generator.
The general idea for not showing the total was to capture a Name, Company, and Email before sending out the total price.
Hands down Gravity Forms is the best form generator out. If you have any questions about this blog or Gravity forms or using WordPress for business just shoot us a message and we would love to help you.
Let us know what you think of the Gravity Forms: How to a Hide Gravity Forms Product Field and Total WordPress Tutorial. Feel free to ask a question or give your two-cents. Additionally, you can continue the discussion on our Free Facebook Group: "WordPress Tutorials & Community Help"