Skip to content

Interest Comparison Calculator

James Pederson edited this page May 17, 2014 · 1 revision

Basic Implementation

Grabs four values from the form, and returns the savings in interest between the two loans. Needs an amount, term, rate, and comparison rate. The comparison rate would generally be provided in a hidden form element.

$(".calculator-compare").accrue({
  mode: "compare"
});

Formatting Output

Plugin options allow you to customize the output of the calculation results.

$(".calculator-compare").accrue({
  mode: "compare",

  // set the result output element
  response_output_div: ".results",

  // set the response format
  response_compare: "Save $%savings% in interest!",

  // set the error text
  error_text: "Please fill in all fields.",

});

See the plugin options to find out more about how to customize the output or change other settings.