• Resolved troop5

    (@troop5)


    I have a calculation field in a form I have created called {calculation-1}. The calculation works correctly, but if I mark the field as HIDDEN, the field value appears as 0 or blank when referenced by other fields in the form. I had the same problem with several number fields, but was able to access the data while simultaneously hiding the fields using the custom CSS option for the form as follows:

    #forminator-field-number-1 {
    visibility: hidden;
    }

    Is there a similar solution for calculation fields? If not, is there a way to hide a calculation fields while still accessing its value? Is the current functionality a feature, a bug or something else?

    Thank you for your help.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hi there @troop5

    Hmm, I’m unable to replicate that. Even if a calculation field in my test form is set to “Hidden”, I can fetch its value in another field or visibility condition just fine.

    Would you mind exporting your form and uploading it to a file sharing service like Drive, Dropbax, pastebin, etc.? Then post a download link here.

    That way, we can test your actual form on our sites to see if there is something perhaps misconfigured in it.

    Cheers!
    Patrick

    Thread Starter troop5

    (@troop5)

    Below is the link to the exported form. Our WordPress site uses a Divi theme. Is it possible that the theme is overriding something? It is strange since I haven’t been able to hide any fields that are part of a calculation by marking them as “hidden” without ruining the calculation, but I have been able to hide them using the Custom CSS settings for the form and the calculation still works – yet this method fails to hide the calculation field. I have been adding the following lines to Custom CSS for fields I want to hide (example field name is “number-2”):

    #forminator-field-number-2 {
    visibility: hidden;
    }

    https://drive.google.com/file/d/17scirmnACDdk1wYj6LUMbznZ7ffIipHU/view?usp=sharing

    Thank you for your help!

    Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hi again @troop5

    Thanks for sharing the form export.

    I imported the form to my test site and double-checked to ensure your URL query parameters and calculation formula are correct; they are. ??

    I then tested the form on my site both with and without the Page Breaks in it, as well as with the Calculation field hidden or not, with and without your CSS to hide certain fields, and also checked with the AdultPrice query parameter set to 0 or 20 (to verify ?if that was any issue).

    In all my tests, the calculation resulted in the correct amount.

    This video shows your form performing as expected, with the AdultPrice set to 20 in the URL query (3 scouts @ $40 + 2 adults @ $20 = $160):

    https://recordit.co/93NCObbNQP

    And here’s a screenshot of the corresponding submission confirming that amount sent to PayPal:

    https://monosnap.com/file/TUFmaGqsswmkmsXzts8os57jetZrc

    So as it appears there is nothing wrong with the form itself, we can only assume there must be something else on your site that is conflicting with the plugin or interfering with the form functionality.

    Have you tested the form with all other plugins and any custom scripts temporarily deactivated?

    Hope this helps!
    Patrick

    Thread Starter troop5

    (@troop5)

    I disabled 3 plugins that weren’t really in use anyway and all of a sudden the hidden calculation works! FYI, the plugins I disabled were:

    Duplicate Page by mndpsingh287
    Query Monitor by John Blackbourn
    Simple Calendar by Simple Calendar

    I reactivated Simple Calendar and it still works.

    Thank you for your help!

    Thread Starter troop5

    (@troop5)

    It appears query monitor is the source of the error. Works now, thank you.

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @troop5,

    Glad to hear you have managed to resolve the issue. Please do let us know if you need any further assistance regarding this.

    Kind Regards,
    Nithin

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hidden calculation fields in a form’ is closed to new replies.