You are viewing limited content. For full access, please sign in.

Question

Question

In a collection, write selected value from dropdown to a textbox

asked on June 21, 2023

I rarely use collections so this is not familiar at all.  It seems simple but I think that is the trap.  Perhaps, it should be simple is a better way to say it.

I've created a very simple form to experiment with.  I enter an ID number at the top of the form and a lookup retrieves the children of the person whos ID was entered.  Each group in the collection represents a single child. The collection will never change after the initial lookup.  

There are three objects in the group:

- a textbox with the ID of the child        id = q5

-a dropdown box                                   id = q7, class = termDrop

- a textbox where I would like to store the value of what was chosen in the dropdown.     id = q8, class = termBox

 

Here is an example of what the form looks like:

 

The behavior I would like is when a term is selected from the dropdown, it is entered into the Term Selected field.  So the Term Selected for Dependent ID would be 2023FA, for Dependent ID 1221339 it would be 2024SP, for Dependent ID 1288149 it would be 2023WI.  

What does the javascript/jquery look like to populate those fields?

 

Thanks...

 

 

 

0 0

Answer

SELECTED ANSWER
replied on June 22, 2023

Thanks Jason,

I knew there had to be a simpler way!

 

 

0 0

Replies

replied on June 21, 2023

Does the value need to be editable? I'm not sure what the purpose of the second field would be if it is just showing the same value.

However, if you don't need the user to change it and you just want an exact match you can do it with functions and no javascript.

For example, in the following you'd just wrap an index function around your dropdown variable.

=INDEX(Collection.Dropdown,ROW())

Which basically says, "use the value of the dropdown field from the same row as this field" (i.e., the sibling dropdown)

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.