Copy link to clipboard
Copied
I am attempting to create a PDF membership form for my sports club and am stuck on one thing. I have a dropdown "MemYear" that is set with options "2020/2021", 2021/2022, and so on. When you select 2020/2021 it exports a value of "30 Sep 2020" to "TEXT1", 2021/2022 exports "30 Sep 2021" and so on/ If it is possible, I would like it so that in addition to the first export to TEXT1 it will also export "December 2020" to TEXT2 and when I select the next option it would export December 2021 and so on.
I can figure out the first part of exporting to TEXT1, but am stumped on how to complete step 2, i.e exporting to TEXT2. Any help would be greatly appreciated as this one really has me baffled.
Thanks in advance
Try this in TEXT2 field:
var drop = this.getField("MemYear").value;
if(drop == "30 Sep 2021"){
event.value = "30 Dec 2021";}
else if(drop == "30 Sep 2022"){
event.value = "30 Dec 2022";}
else event.value = "";
You see how it works so add more options as needed.
Copy link to clipboard
Copied
How do you export to TEXT1?
Copy link to clipboard
Copied
Hi Asim123, I use the Export Value feature in the OPTIONS tab of the dropdown box (MemYear) as per below.
 
Copy link to clipboard
Copied
sorry forgot to include that I use the following Custom Calcualtion Script in TEXT1
event.value = this.getField("MemYear").value;
Copy link to clipboard
Copied
Try this in TEXT2 field:
var drop = this.getField("MemYear").value;
if(drop == "30 Sep 2021"){
event.value = "30 Dec 2021";}
else if(drop == "30 Sep 2022"){
event.value = "30 Dec 2022";}
else event.value = "";
You see how it works so add more options as needed.
Copy link to clipboard
Copied
Thank you, everyone, especially Nesa Nurani - your solution worked perfectly
Copy link to clipboard
Copied
Replace :
event.value = this.getField("MemYear").value;
By:
event.value = this.getField("MemYear").valueAsString;