Copy link to clipboard
Copied
So I have this custom calc to auto populate phone numbers if a certain insurance is selected... but my insurance field is set to allow custom text for third party insurances. How do I add a code to allow for custom text to enter in a different phone number if a custom text is put in the insurance section?
var fieldA = this.getField("Insurance").valueAsString;
if (fieldA=="BCBS Federal") event.value = ("1(800)442-4607");
else if (fieldA=="BCBS TX") event.value = ("1(800)451-0287");
else if (fieldA=="BCBS") event.value = ("1(800)676-2583");
else if (fieldA=="UHC") event.value = ("1(877)842-3210");
else if (fieldA=="Cigna") event.value = ("1(800)244-6224");
else event.value="";
Copy link to clipboard
Copied
A calculation script is not ideal for what you want to do. It would be better if this script was in the validation or keystroke script for the dropdown. Of course you'll need to switch the field acquisition.
Then you can also add code to set the Read Only property of the phone field.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now