Skip to main content
Participating Frequently
March 7, 2018
Question

automatically populate from dropdown field

  • March 7, 2018
  • 2 replies
  • 630 views

I would like a text box to automatically populate with a single letter refering to what was chosen in a dropdown menu ? how do i code this please?

drop down                text box

heli 1                              a

heli 2                              b

heli 3                              c

heli 4                              d

This topic has been closed for replies.

2 replies

Participant
March 30, 2018

Is there a way once this script is set up to allow the user to overwrite that field with a custom entry?  This works EXCELLENT but there are a few cases in my process where a custom entry into that field would still be necessary at times but it seems that every time I try to enter something in it is just overwritten by the script again.  Thanks for any help you might have!

try67
Community Expert
Community Expert
March 30, 2018

Add this line of code before the current one:

if (event.source && event.source.name=="dropdown")

Participant
March 30, 2018

Excellent!!! You just made my day.  Thanks! I'm not very good at code at all (meaning I have no idea what I'm doing ever) but this worked great.  Thanks a lot!

try67
Community Expert
Community Expert
March 7, 2018

Put these letters as the export values of the items in the drop-down, and then use this code as the custom calculation script of the text field:

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

Participating Frequently
March 7, 2018

makes sense but its not working

Participating Frequently
March 7, 2018

My bad !!! it works !!!!!! thank you so much