Copy link to clipboard
Copied
Hello, I'm sorry for the ignorance but I'm wracking my brain trying to figure this out.
I have a document where I need the results from FormFieldA = FormFieldB only if FormFieldA is negative. If the number in FormFieldA is a positive number, I want FormFieldB to be 0.
I hope that makes sense.
Copy link to clipboard
Copied
Hi @Arianna306683197h1w ,
I think you can take care of that with a Custom Calculation Script or a Custom Validating Script executed in FormFieldA.
Maybe something like this:
(event.value >= 1) ? this.getField("FormFieldB").value = event.value : this.getField("FormFieldB").value = 0;
I have not tested the script myself but see if this works for you.
Copy link to clipboard
Copied
This wouldn't check if for example value is 0.1, also it duplicates value if it's positive number and OP wanted to duplicate if it's negative number, so it would be better to check that value is less than 0:
(Number(event.value) < 0) ? this.getField("FormFieldB").value = event.value : this.getField("FormFieldB").value = 0;
Copy link to clipboard
Copied
Thank you as usual @Nesa Nurani for keeping an eye.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more