Skip to main content
Known Participant
December 5, 2020
Answered

Populating two text fields from one dropdown

  • December 5, 2020
  • 2 replies
  • 946 views

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

This topic has been closed for replies.
Correct answer Nesa Nurani

sorry forgot to include that I use the following Custom Calcualtion Script in TEXT1

event.value = this.getField("MemYear").value;


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.

2 replies

JR Boulay
Community Expert
Community Expert
December 5, 2020

Replace :

event.value = this.getField("MemYear").value;

 

By:

event.value = this.getField("MemYear").valueAsString;

Acrobate du PDF, InDesigner et Photoshopographe
Inspiring
December 5, 2020

How do you export to TEXT1?

Paul5D64Author
Known Participant
December 5, 2020

Hi Asim123, I use the Export Value feature in the OPTIONS tab of the dropdown box (MemYear) as per below.

Paul5D64Author
Known Participant
December 5, 2020

sorry forgot to include that I use the following Custom Calcualtion Script in TEXT1

event.value = this.getField("MemYear").value;