After experimenting with the script, I discovered that it did not perform as expected (even though it works on Google Webapp's script HTML form). My goal is to invalidate an input if the Downpayment is less than 30% or more than 100% of the Price, in which case the response should be Invalid Input. Can anyone provide guidance on what needs to be modified within this script?
//------------------------Process---------------------------------------//
document.getElementById("btn").addEventListener("click", doStuff);
function doStuff() {
const rate = 0.155;
const vprice = document.getElementById("price").value;
const downPayment = document.getElementById("DownPay").value;
const period = document.getElementById("app").value;
var nf = new Intl.NumberFormat(); //number format
const res = nf.format(Math.round((vprice - downPayment) * rate / period));
document.getElementById("res").innerHTML = "Your Estimated Monthly Rental: "+ res;
google.script.run.userClicked({
vprice,
downPayment,
rate,
period,
res
});
}