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

Question

Question

Use row labels from one table as options for field inside another table?

asked on November 20, 2014

So I have seen code around here for populating tables with information based on SQL Lookups, but what if we want the second, or third table in a form to have however many options as there are rows in a repeatable table at the top of the form.

 

In the first table, I can add and add row after row into the table and key in information. now every time I add a row, I want that row name to be added as an option to a dropdown in my second table. This will be used to associate information between two tables in a form I am working on, but I figured I can use all the help I can get in making sure I do this right. I will be testing this out myself and let you know if I have any luck without assistance.

0 0

Replies

replied on November 20, 2014

As you are looping through the values pulled back by the lookup to fill your table rows, you might also be able to use a selectObject.add(option,indexto add each row name to your dropdown list.

Good Luck! 

0 0
replied on December 8, 2014

remove would be selectObject.remove(option)? 

The index is the index of the new item? so it should be 1 more than the last option was in order not to overwrite anything?

0 0
replied on December 10, 2014

Yes, this is how I would index it. Note that I have not tested this code, it is merely a suggestion.

Are you actually trying to perform a look-up? Or are you just adding rows to a table and want to see yur changes later in the form? 

0 0
replied on December 10, 2014

performing a lookup at first, but then the user fixes information and stuff and thats the information that is to be used in subsequent areas

0 0
replied on December 10, 2014

Ok, so how are you adding the lookup values to the table rows?

When I have done this before, I have filled a drop down menu with the every value that was returned by the lookup. Then, I loop through the values in that drop down, adding each one to a table row. My though was, when you are looping through these values and adding them to the first table, you could also add them to the subsequent tables. 

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

Sign in to reply to this post.