Skip to content

Instantly share code, notes, and snippets.

@jpederson
Last active August 29, 2015 13:57
Show Gist options
  • Save jpederson/9496630 to your computer and use it in GitHub Desktop.
Save jpederson/9496630 to your computer and use it in GitHub Desktop.
Accrue.js complete example with all options.
$( selector ).accrue({
mode: "basic",
operation: "keyup",
default_values: {
amount: "$7,500",
rate: "7%",
rate_compare: "1.49%",
term: "36m",
},
field_titles: {
amount: "Loan Amount",
rate: "Rate (APR)",
rate_compare: "Comparison Rate",
term: "Term"
},
button_label: "Calculate",
field_comments: {
amount: "",
rate: "",
rate_compare: "",
term: "Format: 12m, 36m, 3y, 7y"
},
response_output_div: ".results",
response_basic:
'<p><strong>Monthly Payment:</strong><br>$%payment_amount%</p>'+
'<p><strong>Number of Payments:</strong><br>%num_payments%</p>'+
'<p><strong>Total Payments:</strong><br>$%total_payments%</p>'+
'<p><strong>Total Interest:</strong><br>$%total_interest%</p>',
response_compare: "Save $%savings% in interest!",
error_text: "Please fill in all fields.",
callback: function ( elem, data ){}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment