Skip to main content
New Participant
July 12, 2022
Answered

auto fill a text box based on a value from a list box

  • July 12, 2022
  • 3 replies
  • 1533 views

Hello all, 

 

I am creating a form and I have a list box that has three values in it (or four if you include the black space).  I would like a text box to auto-populate with a value based on the value of the list box.  I found this from another thread and have tried to adapt it for my purpose but I am not getting any value to load.  What is posted is modified.

 

event.value = (this.getField("List Box 1").valueAsString=="1")?"": apple

 

Any help would be appreciated

 

This topic has been closed for replies.
Correct answer baersteve

I might still need help with the defining of the name.  I am trying to use what was posted previously first.

 

Thank you for the help that you have provided.

3 replies

try67
Adobe Expert
July 12, 2022

If "apple" is text then it must be in quotes. If it's the name of a variable then you have to define that variable first, and that's not present in the code you posted.

baersteveAuthorCorrect answer
New Participant
July 14, 2022

I might still need help with the defining of the name.  I am trying to use what was posted previously first.

 

Thank you for the help that you have provided.

JR Boulay
Adobe Expert
July 12, 2022
Acrobate du PDF, InDesigner et Photoshopographe
baersteveAuthor
New Participant
July 14, 2022

Thank you for this.  I will read it over and see if I can use it to adapt to what I have.

Bernd Alheit
Adobe Expert
July 12, 2022

Check the Javascript console for errors.

baersteveAuthor
New Participant
July 12, 2022

I am not familiar javascript so I would need a little guideance.

Bernd Alheit
Adobe Expert
July 12, 2022

Press ctrl-j or cmd-j