• Resolved niklaskristiansson

    (@niklaskristiansson)


    Hi,
    Thanks for a great plug in!

    I use a “calculated field” to add up values from several fields (let’s say fieldname1, fieldname2 & fieldname3). This “calculated field” is hidden until a button that says “calculate” is clicked. Using this code for the OnClick event: jQuery(‘.my-field’).removeClass(‘hide’);

    I would like to have the “calculated field” hidden as soon as any of the values inside any of my input fields (fieldname1, fieldname2 & fieldname3) change. And then reveal the calculations field once you click the “calculate button”.

    How can I achieve this?

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

    (@codepeople)

    Hello @niklaskristiansson

    The alternative would be to assign two class to the calculated field: hidden special-field

    And then, you can insert an “HTML Content” field with the piece of code:

    <script>
    jQuery(document).on('change', '[id*="fieldname1_"],[id*="fieldname2_"],[id*="fieldname3_"]', function(){jQuery('.special-field').addClass('hide');});
    </script>

    And that’s all.

    Best regards.

    Thread Starter niklaskristiansson

    (@niklaskristiansson)

    Ah nice, works great!

    Thanks again for a great plug in and thanks for the fast reply!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Rest calculation when one or another field change’ is closed to new replies.