• Resolved mlawrence83

    (@mlawrence83)


    I’m very new to this plugin, but I am struggling to find an answer to this. I want to display calculated totals in a separate section on the page, but have them adjust as the user changes the inputs. I don’t want them to have to submit the form to see the new results.

    It works in the results section below the form, but I want to display it separately with a shortcode or something, so that I can format the look in Elementor.

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

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

    (@codepeople)

    Hello @mlawrence83

    Thank you very much for using our plugin. I’ll try to describe the process with an example.

    Assuming you have the equation fieldname1+fieldname2, but you want to display the result in another place in the page. For example a div tag with clas name result-here.

    In this hypothetical case, you can edit the equation as follows:

    (function(){
    var result=fieldname1+fieldname2;
    jQuery('.result-here').html(result);
    return result;
    })()

    The equation calculates the result, displays it in the tag, and then returns the result to the calculated field.

    Best regards.

    Thread Starter mlawrence83

    (@mlawrence83)

    Wow, I wish all plugin creators were this helpful. Thanks so much! I think this is working perfectly.

    Thread Starter mlawrence83

    (@mlawrence83)

    @codepeople How would I format the result to be currency, with two decimal places and commas for thousands separator?

    • This reply was modified 1 year, 6 months ago by mlawrence83.
    Plugin Author codepeople

    (@codepeople)

    Hello @mlawrence83

    The plugin includes the PREC operation you can use after complete all mathematical operations:

    PREC(X, Y) rounds the number X with Y decimals.

    Similarly, you can call the FORMAT operation.

    https://cff.dwbooster.com/documentation#mathematical-module

    Continuing with the previous equation, it can be edited as follows:

    (function(){
    var result=PREC(fieldname1+fieldname2, 2);
    
    
    result = FORMAT(result, {groupingsymbol:",", decimalsymbol:"."});
    
    jQuery('.result-here').html(result);
    return result;
    })()

    Best regards.

    Thread Starter mlawrence83

    (@mlawrence83)

    This is perfect! Thanks so much!

    Thread Starter mlawrence83

    (@mlawrence83)

    Thank you again, and I just wrote a well deserved five star review.

    Plugin Author codepeople

    (@codepeople)

    Hello @mlawrence83

    Thank you very much.

    Best regards.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Display Total in Separate shortcode in Realtime’ is closed to new replies.