I am trying to add a formula to my gravitational form (WordPress), which includes exponent.i can not use the built-in calculator, since there is no exponent function. its basically a loan calculator where.
r = rate; (form_id = 4) / 12
p = loan amount; (form_id = 1)
D = Duration (form_id = 2, [drop-down menu]) * 12
X = p (g / 1- (1 + g) ^ - D)
X = repayment
Now I get r, p and D from the form in the form of drop-down and written numbers.
so far I have put the HTML field and pasted this code into it:
<script> gform.addFilter( 'gform_calculation_result', function(result, formulaField, formId, calcObj ){ if ( formulaField.field_id == "2" ) { result = ; } return result; }); </script>
I don't have bg programming, and I got it from a member of the support team.
I understand that this code will replace the calculation of field_id 2 (which shows X = [monthly repayment] with the result of my formula β "/ **** /"
But I need to write a formula, and I donβt know how to get the values ββfrom the form using jQuery and put them in the formula.
I learned the math functions of JavaScript from W3school and another website, so I have no problem writing a formula. I just need help with jQuery to get the value.
I was wondering if anyone can help me with this?
javascript jquery wordpress gravity-forms-plugin
Amin gharavi
source share