Copy link to clipboard
Copied
I work for a financial institution and I'm trying to create a form for our automatic payments. If Text1 (aka the loan number) is beween 0800 and 0899 OR 8000 and 8999 OR 0900 and 0999 OR 9000 and 9999 then I need Text2 to be visible and say "Variable Rate Payment".
OK, then you can use this code as the custom Calculation script of Text2:
var v = Number(this.getField("Text1").valueAsString);
if ((v>=800 && v<=899) || (v>=8000 && v<=8999) || (v>=900 && v<=999) || (v>=9000 && v<=9999))
event.value = "Variable Rate Payment";
else event.value = "";
Copy link to clipboard
Copied
Hi there
Hope you are doing well and sorry to hear that.
The workflow you are trying to achieve is possible using JavaScript. For more information please check the help pages listed below:
https://acrobatusers.com/tutorials/javascript_console/
https://helpx.adobe.com/acrobat/using/applying-actions-scripts-pdfs.html
Hope it will help
Regards
Amal
Copy link to clipboard
Copied
And if it's not?
Copy link to clipboard
Copied
If it's not one of those numbers or any in between then I need Text2 to just be blank.
Copy link to clipboard
Copied
OK, then you can use this code as the custom Calculation script of Text2:
var v = Number(this.getField("Text1").valueAsString);
if ((v>=800 && v<=899) || (v>=8000 && v<=8999) || (v>=900 && v<=999) || (v>=9000 && v<=9999))
event.value = "Variable Rate Payment";
else event.value = "";
Copy link to clipboard
Copied
Be sure that it uses a "Number" format and place this script as a validation script in Text1:
var oFld = this.getField("Text2");
if ((event.value >= 800 && event.value <= 899) || (event.value >= 8000 && event.value <= 8999) || (event.value >= 900 && event.value <= 999) || (event.value >= 9000 && event.value <= 9999)) {
oFld.value = "Variable Rate Payment";
oFld.display = display.visible;
}
else {
oFld.value = oFld.defaultValue;
oFld.display = display.hidden;
}
Copy link to clipboard
Copied
It doesn't appear that this is actually doing anything. It's not showing or hiding the box, and it's not putting in the text. I have entered the formula in the "run custom validation script" box on the validate tab. It's not giving me an error or anything - it's just not working. Any suggestions?
Copy link to clipboard
Copied
Can you share (part of) this document?