How to correctly calculate costs with a returned field

New Here ,
Sep 16, 2022 Sep 16, 2022

Copy link to clipboard

Copied

This pdf I'm working on if working correctly should allow you to select an item from the drop down and then show the cost of the item issued, once returned the cost should return back to 0 because we recieved the issued laptop back. However, once returned the value goes from say 600 to -600 instead of going back to zero.

The only code written so far is the format for the select Item categories, I do not know if I need to modify this code to work properly or write something for each CostRow 

if( event.willCommit ) {
if(event.value == "") this.resetForm(["CostRow1"]); else SetFieldValues(event.value, "CostRow1");
}

Screenshot 2022-09-16 091103.png

 

TOPICS
Comment review and collaborate PDF , Create PDFs , Edit and convert PDFs , How to , JavaScript

Views

20

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 16, 2022 Sep 16, 2022

Copy link to clipboard

Copied

LATEST

I fixed it as soon as I posted this haha, If you run into a similar problem just copy the custom keystroke to the retuned field and if 1 is entered reset teh costrow field. Then do that for all 13 rows i.e 

if( event.willCommit ) {
if(event.value == "1") this.resetForm(["CostRow1"]); else SetFieldValues(event.value, "CostRow1");
}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

Make content for your business needs with Adobe Express.

Get started easily with free templates: