PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

hide a field that uses formula

  1. i have a form that calculates a width input & Height Input.

    It then calculates area and multiplies it by the selected material option.

    i then add this formula to a "product field" and this seems to give me my correct values on the Total before i add it to my woocommerce basket.

    What i wanted to know is how do i hide the "product field ID 19" from customers view, yet remain operational in its formula calculations.

    i tried .hidden {visibility: hidden!important; } in my wordpress themes custom .css file but its still visable, if i use conditional logic for something bizar like if total area = 999999999 but then the calculations dont give me the correct values but it hides the field.

    am i doing something wrong here?

    Posted 11 years ago on Thursday January 17, 2013 | Permalink
  2. Please provide a link to the page on your site where the form is visible, and we can help you hide the field. Thank you.

    Posted 11 years ago on Thursday January 17, 2013 | Permalink
  3. http://www.superwideprints.co.uk/shop/mesh-outdoor-banner/

    the current form i am building

    the formula for the "condition subtotal"

    is the following;
    {Area:10} * {Substrate:20} - {Substrate:20}

    my calculations all work as intended i just need to hide the "conditional subtotal" and it still work.

    Posted 11 years ago on Thursday January 17, 2013 | Permalink
  4. I was able to hide it from visitors by adding this CSS to one of your stylesheets:

    [css]
    body .gform_wrapper li#field_3_19 {
     display:none;
    }

    I'm not sure once it's hidden if the calculation will continue to work.

    Posted 11 years ago on Thursday January 17, 2013 | Permalink
  5. it made it hidden but the calculation didn't work now.

    Posted 11 years ago on Thursday January 17, 2013 | Permalink
  6. instead of hiding the field i just made the text white.... seems to work tho =p

    body .gform_wrapper li#field_3_19 {
        color: #FFFFFF;
    }
    
    .gform_wrapper span.ginput_product_price {
        color: #FFFFFF;
    }

    instead of apply this to field id 19 how can i apply it to all fields, this form will be duplicated multiple times.

    Posted 11 years ago on Thursday January 17, 2013 | Permalink
  7. I was going off your first information that hiding it did not work. I did not think a hidden field would work in a calculation.

    Making it white on white, or a smaller font, or moving it off the page was going to be my next suggestion.

    Did you have a question about applying it to more fields or were you just showing how you did it?

    If you are going to hide more information by making the text white on white, I would give those fields a custom CSS class (on the advanced tab of that field in the form builder) and then modify your CSS to target fields with that class.

    Posted 11 years ago on Thursday January 17, 2013 | Permalink
  8. yes good idea,

    how would i go about making the class and calling it for future form elements

    at the moment my custom .css file contains;

    body .gform_wrapper li#field_3_19 {
        color: #FFFFFF;
    }
    .gform_wrapper span.ginput_product_price {
        color: #FFFFFF;
    }

    can i make this small then just call the class in the advanced tab for example; .whiteText

    Posted 11 years ago on Thursday January 17, 2013 | Permalink
  9. ehong33234
    Member

    Very interesting information and I am looking for a solution for this as well.

    Please keep this thread open, thanks.

    Posted 11 years ago on Friday January 25, 2013 | Permalink
  10. chino
    Member

    can't think exactly but if you made the div 0px high and wide and did overflow: hidden; does that do the same thing as display: hidden?

    funny, i'm creating the same sort of site as you are. running into percentages problem.

    Posted 11 years ago on Friday January 25, 2013 | Permalink
  11. Interesting topic. I tried all in this topic and nothing worked out. I was able to hide the calculation field but then nothing was calculating anymore.

    Hope someone has a solution. Calculation hiding with numbers works but not with price fields.

    Posted 11 years ago on Monday January 28, 2013 | Permalink
  12. David Peralty

    Gravity Forms was never meant to be a fully fledged e-commerce system and so there are compromises that must be made if you want to use our functionality.

    Calculations are done through JavaScript and so you can't hide it on the page or it hides it from JavaScript and then doesn't work.

    Posted 11 years ago on Tuesday January 29, 2013 | Permalink
  13. Thanks for your explanation David.

    If this isn't possible then the only solution is to hide the price field in the css file.
    I'm not good at coding css files. Maybe there is somebody that could help me out hiding the price in the css.

    Many thanks.

    Posted 11 years ago on Tuesday January 29, 2013 | Permalink
  14. ehong33234
    Member

    Yes please! Can someone help with the custom CSS code to hide a certain field? Thanks!

    Posted 11 years ago on Saturday February 9, 2013 | Permalink
  15. I would not hide it with the "display:none" CSS since that removes it from the calculations as well. How about moving it off the page so it's not visible. Something like this applied to the class (gf_offpage as an example here) you add to the fields you don't want visible:

    [css]
    body .gform_wrapper .gf_offpage {
       position: absolute !important;
       top: -9999px !important;
       left: -9999px !important;
    }
    Posted 11 years ago on Sunday February 10, 2013 | Permalink
  16. Hi!

    The last code works perfectly, but and to hide it from cart??

    thanks!!

    Posted 10 years ago on Monday May 13, 2013 | Permalink