• Resolved rodbrandt

    (@rodbrandt)


    Hi. Great plugin!

    I need help figuring a few things out:
    1) I have two forms on the same page and the calculated results from one form are displaying on the second form. How do I prevent this?
    2) I want the calculation to display as both Feet and Inches, but only Inches is displaying in both results.
    3) Comma delineator is not working for me.

    Here is a video explaining the issues:
    https://www.dropbox.com/s/ykv4kjitafk7zih/calculated_forms_conflicts.mp4?dl=0

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

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

    (@codepeople)

    Hello @rodbrandt,

    The issue is very simple, in each form you have inserted a pair of HTML Container fields, each of them with a DIV tag with the class: equation-result and into each equation you have entered the piece of code:

    
    jQuery('.equation-result').html(result);
    

    So, you’re entering the result as HTML into all tags with class name: equation-result, displaying the same result in all of them.

    The solution is simple too, assign an unique class name to each DIV tag entered into the “HMTL Content” fields. For example, inserting the following DIV tags:

    
    <div class="equation-result-1"></div> <h6>cubic feet needed</h6>
    

    and

    
    <div class="equation-result-2"></div> <h6>cubic inches needed</h6>
    

    And then the pieces of code to use as part of the equations would be:

    
    jQuery('.equation-result-1').html(result);
    

    and for the second equation:

    
    jQuery('.equation-result-2').html(result);
    

    Implement the same solution in the second form, but using another pair of class names.

    Best regards.

    Thread Starter rodbrandt

    (@rodbrandt)

    Thank you – worked perfectly! Last thing is the comma not showing on the thousands separator; I can’t get that to work.

    Plugin Author codepeople

    (@codepeople)

    Hello @rodbrandt,

    Because you are not showing the results in the calculated fields (you are assigning them to HTML Content fields from the equations), the code that formats the number is not being executed, in whose case you should run it manually.

    I’ll try to describe the process modifying one of your equations.

    You’ve implemented the equation:

    
    (function(){
    var result = prec((fieldname2+fieldname20/12)*(fieldname24+fieldname6/12)*(fieldname10+fieldname25/12),2);
    jQuery('.equation-result-1').html(result);
    return result;
    })()
    

    edit it as follows:

    
    (function () {
    var result = prec((fieldname2 + fieldname20 / 12) * (fieldname24 + fieldname6 / 12) * (fieldname10 + fieldname25 / 12), 2), tmp;
    tmp = fbuilderjQuery.fbuilder.calculator.format(result,{decimalsymbol:'.',groupingsymbol:','});
    jQuery('.equation-result-1').html(tmp);
    return result;
    })()
    

    and that’s all.
    Best regards.

    Thread Starter rodbrandt

    (@rodbrandt)

    Perfect – thank you so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Need to unlink forms’ is closed to new replies.