test page Loan Amount *USDYearsEst Monthly Payment*( 7.99% APR )Code document.getElementById("forminator-field-currency-1").addEventListener("change", calculate); calculate(); function calculate() { console.log("Triggered"); // Get the user's input from the form. Assume it is all valid. // Convert interest from a percentage to a decimal, and convert from // an annual rate to a monthly rate. Convert payment period in years // to the number of monthly payments. var principal = document.getElementById("forminator-field-currency-1").value; var interest = 7.99 / 100 / 12; var payments = document.getElementById("forminator-field-number-3").value * 12; // Now compute the monthly payment figure, using esoteric math. var x = Math.pow(1 + interest, payments); var monthly = (principal*x*interest)/(x-1); // Check that the result is a finite number. If so, display the results. if (!isNaN(monthly) && (monthly != Number.POSITIVE_INFINITY) && (monthly != Number.NEGATIVE_INFINITY)) { var monthypayments = round(monthly); var loanpayments = round(monthly * payments); var interpayments = round((monthly * payments) - principal); console.log(monthypayments); document.getElementById("forminator-field-text-1").value = "$" + monthypayments; document.getElementById("forminator-field-text-1").disabled = true; } } // This simple method rounds a number to two decimal places. function round(x) { return Math.round(x*100)/100; } Send MessagePlease do not fill in this field. Please do not fill in this field. Please do not fill in this field.