Copy link to clipboard
Copied
I am looking for some help with form field calculations .
1. I need to multiply "TGAI" * 0.03 , but if "MedicalExpenses" is empty then leave return the value of "0".
2. If "HPW" AND "WPY" are blank then leave cell blank if "HPW" AND "WPY" have values then multiply "HW" * "HPY"
Thank you for any help you can provide.
A couple of issues:
1) You had a validation script AND a calculation script in the field. Remove the validation script.
2) You missed the ! in my script, which changes the statement to a value vs no value. Here's the calculation script again (copy and paste it).
if(!this.getField("MedicalDeduction").value)
{event.value=0}
else
{event.value=this.getField("Calc_TotalGAI").value * .03 * -1}
if(!this.getField("GMI.0").value)
{event.value=25}
else
{event.value=this.getField("Calc_TotalMonthlyPayment").value-this.getField("Utilities").value}
Copy link to clipboard
Copied
1.
if(!this.getField("MedicalExpense").value)
{event.value=0}
else
{event.value=this.getField("TGAI").value * .03 * -1}
2.
if(this.getField("HPW").value && this.getField("WPY").value)
{event.value=this.getField("HPW").value * this.getField("WPY").value}
else
{event.value=""}
Copy link to clipboard
Copied
Good morning and thank you for your response . the script provided for #1 does not work , but #2 does .
Copy link to clipboard
Copied
What result are you getting. Do you have errors in the console?
Copy link to clipboard
Copied
Thats the odd thing, im not getting any error messages , its just not calculating .
Copy link to clipboard
Copied
Can you upload your document?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
A couple of issues:
1) You had a validation script AND a calculation script in the field. Remove the validation script.
2) You missed the ! in my script, which changes the statement to a value vs no value. Here's the calculation script again (copy and paste it).
if(!this.getField("MedicalDeduction").value)
{event.value=0}
else
{event.value=this.getField("Calc_TotalGAI").value * .03 * -1}
Copy link to clipboard
Copied
That worked , thank you so much , now i just have one more issue on this form and im done with it .
if you dont mind taking a look when you get a chance i would really appriciate it .
I have left notes on the form and included the entire worksheet this time for your reference .
Again , thank you for your time
Copy link to clipboard
Copied
if(!this.getField("GMI.0").value)
{event.value=25}
else
{event.value=this.getField("Calc_TotalMonthlyPayment").value-this.getField("Utilities").value}
Copy link to clipboard
Copied
Thank you so much for your help !