Copy link to clipboard
Copied
Hi. I was wondering if anybody could help with IF statements on a fillable PDF form?
I have a drop down box which has four options for the person filling in the form to select. They must choose one option.
When they select one of the options I would like specific text to appear in a box on the form. So, for example if I select option 1 from the drop down options, the text 'well done blah blah blah' will appear in a text box. If I select option 2 from the drop down options, the text 'Welcome back' will appear in the text box. If I select option 3 from the drop down options, the text 'Please take care' will appear in the text box?
Any help appreciated
Thanks
Try this in " Custom Calculation Script" of text field:
var drop = this.getField("Dropdown1").valueAsString;
if(drop == "item1"){
event.value = "Some text1";}
else if(drop == "item2"){
event.value = "Some text2";}
else if(drop == "item3"){
event.value = "Some text3";}
else if(drop == "item4"){
event.value = "Some text4";}
Change dropdown field name if needed.
Copy link to clipboard
Copied
Try this in " Custom Calculation Script" of text field:
var drop = this.getField("Dropdown1").valueAsString;
if(drop == "item1"){
event.value = "Some text1";}
else if(drop == "item2"){
event.value = "Some text2";}
else if(drop == "item3"){
event.value = "Some text3";}
else if(drop == "item4"){
event.value = "Some text4";}
Change dropdown field name if needed.
Copy link to clipboard
Copied
Hi,
Just to add to the above, if you have default value, so it if it is not "item1", "item2", or "item3" you want some default text to show you can skip the if and just have
if(drop == "item1"){
event.value = "Some text1";}
else if(drop == "item2"){
event.value = "Some text2";}
else if(drop == "item3"){
event.value = "Some text3";}
else {
event.value = "default text";}
Regards
Malcolm
Copy link to clipboard
Copied
Super. Many Thanks.
Copy link to clipboard
Copied
Great. Thank you. Works perfectly.