Skip to main content
Known Participant
August 10, 2016
Question

Trigger multiple drop downs with single click?

  • August 10, 2016
  • 2 replies
  • 631 views

I have four drop downs. Drop1, Drop2, Drop3, and Drop4. Each has an associated text field to show export values. I would like when clicking Drop1 then Drop2, Drop3, and Drop4 would trigger and place each of the drop downs values in the text fields. Doesn't sound too complicated to me, but I cannot find the correct script (and believe me I've searched). Can someone help me out and provide a script that would do what I'd like? Thanks guys.

Here's a script that comes very close to doing what I want. Kinda works but it will trigger only one drop down field and one text field. Is there a similar script that would trigger all the drop downs and text fields?

Sample script in the Custom Keystroke in Drop1:

if(event.willCommit)

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

if(event.willCommit)

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

if(event.willCommit)

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

This topic has been closed for replies.

2 replies

JR Boulay
Community Expert
Community Expert
August 17, 2016

Please, post a link to your example file here on the forum since I'm not the only one that can help you.

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
August 16, 2016

Hi.

You just have to place a JavaScript like this one as a "calculation script" into each text field:

event.target.value = this.getField("Dropdown1").value;

Where Dropdown1 is the name of the targeted dropdown.

See that sample file: Framadrop - Partagez des fichiers de façon anonyme

Acrobate du PDF, InDesigner et Photoshopographe
pdfUser1Author
Known Participant
August 16, 2016

Heya JR,

Thanks for the reply. The script you provided doesn't exactly do what I'm trying to accomplish. In your example both drop downs do not have export values. In your example, it places the name of Dropdown1 into the text field. If I copy and paste the line of script into custom calc of Text4 then Dropdown1 name goes into Text4. Not what I want to do.

What I have is, at least, four drop downs which contain the same names but different export values (i.e., address in Drop1, SSN in Drop2, WorkClass in Drop3 and PayRate in Drop4). What I'm trying to do is to trigger each drop down to place their export values into text fields when I select a name in Dropdown1. The script I provide will work, but only for one drop down and one text field.

Very basically, I'm trying to make filling out my form automatic and time saving. I'm not trying to place the same info (values) in all the fields. I want to place each drop down info in the corresponding text field. It should be easy, shouldn't it?

If you'd like shoot me your email and I'll send you an example of what I am trying to do. Perhaps it would give you a better idea than my written explanation.

Participant
August 22, 2016

Try this: DropDownBox with more export values for each item

Drop down box with more export values :: scoreboards