Copy link to clipboard
Copied
how can i do this?
Copy link to clipboard
Copied
You need to employ a script.
See example below:
var amount = Number(this.getField("AMOUNT1").value);
var schedule = this.getField("SCHEDULE1").valueAsString;
if (amount =="" || schedule =="") {
event.value = "";
} else {
if (schedule !=="") {
if(schedule == "Weekly") event.value = amount;
else if(schedule == "Monthly") event.value = util.printf("%.2f", (amount / 12));
else if(schedule == "YEARLY") event.value = amount * 4;
}
}
Just modify the field names when you declare the variables with what you have in your PDF form.
I just made up the names of the fields based on your screenshot to "SCHEDULE1" for the dropdown menu, and "AMOUNT1" for the dollar value field.
Here's a working file that you can evaluate :
Copy link to clipboard
Copied
Here you go:
https://drive.google.com/file/d/1v3bZ2kg4WBhgsgzGpwSbjOrPKK7KOhuh/view?usp=share_link
You have very poorly field naming, so I changed some field names, so it's easier to calculate.
Script is in "MonthlyCharge12" field as custom calculation script, it will calculate all rows.
Copy link to clipboard
Copied
Anyone help me please. I need this urgent
Copy link to clipboard
Copied
You need to employ a script.
See example below:
var amount = Number(this.getField("AMOUNT1").value);
var schedule = this.getField("SCHEDULE1").valueAsString;
if (amount =="" || schedule =="") {
event.value = "";
} else {
if (schedule !=="") {
if(schedule == "Weekly") event.value = amount;
else if(schedule == "Monthly") event.value = util.printf("%.2f", (amount / 12));
else if(schedule == "YEARLY") event.value = amount * 4;
}
}
Just modify the field names when you declare the variables with what you have in your PDF form.
I just made up the names of the fields based on your screenshot to "SCHEDULE1" for the dropdown menu, and "AMOUNT1" for the dollar value field.
Here's a working file that you can evaluate :
Copy link to clipboard
Copied
I can't do the task can you please give me 1st/2nd row?
Copy link to clipboard
Copied
Please do the 1st row me. The field is setup, you just give me one row and I will do the rest
Copy link to clipboard
Copied
Here you go:
https://drive.google.com/file/d/1v3bZ2kg4WBhgsgzGpwSbjOrPKK7KOhuh/view?usp=share_link
You have very poorly field naming, so I changed some field names, so it's easier to calculate.
Script is in "MonthlyCharge12" field as custom calculation script, it will calculate all rows.
Copy link to clipboard
Copied
Thank you so much
Copy link to clipboard
Copied
Hlw
Copy link to clipboard
Copied
Many many thanks. The script is working
Copy link to clipboard
Copied
You're welcome.

