• Resolved jhilado

    (@jhilado)


    Hi,

    I have a form that only shows the user entry fields, and the calculated field is hidden. However, I want the results to show after the Calculate button is pressed. I have “Eval dynamically the equations associated to the calculated fields” unticked, but that only solves the real-time computation, and not the actual displaying of a hidden calculated field. So it is basically a show/hide div after the button is pressed. How can this be integrated on the form? Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @jhilado,

    In this case you should not tick the checkbox: “Hide Field From Public Page” property of the calculated field, because in this case the field is inserted using the an <input type="hidden"> tag.

    You simply should enter the special class: hide through the property: “Add CSS Layout Keywords”, and then use the following piece of code as part of the equation:

    jQuery('.hide').removeClass('hide');

    Assuming that your current equation is for example: fieldname1+fieldname2 you should edit it similar to:

    (function(){
    jQuery('.hide').removeClass('hide');
    return fieldname1+fieldname2;
    })()

    Best regards.

    Thread Starter jhilado

    (@jhilado)

    It worked, thanks so much!

    How about including the div that holds the hidden fields? This is so when the fields appear, I can style the container with borders. Without hiding the container, there is an empty div with borders that does not populate until I press the calculate button.

    Thread Starter jhilado

    (@jhilado)

    Also buttons? I can’t apply the function you provided since buttons and divs do not have equation fields.

    Plugin Author codepeople

    (@codepeople)

    Hello,

    To include a “DIV” tag directly, you should insert a “HTML Content” field in the form, and enter directly the tag into its content with the styles to apply to the tag as the “style” attribute.

    If you want to display the DIV tag pressing a button, you simply should enter the following piece of code as the onclick event of the button field:

    jQuery('.hide').removeClass('hide');

    and that’s all.
    Best regards.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show hidden results after button click’ is closed to new replies.