T
T
teodolit2020-12-08 12:38:20
Yii
teodolit, 2020-12-08 12:38:20

How to load values ​​from another table in the record creation form?

Good afternoon.
The situation is as follows - Table 1 has a field, the values ​​for which must be taken from another table (table 2). And when creating a new record in table1 - for this field, the user needs to show a list of valid values, from which he will choose the right one. These values ​​should be taken from table 2. So I don’t understand how to do this. So far, there is only a crutch idea - on the page to secretly display a list of records from the 2nd table, and using js to create a select with the desired values, but I'm sure that this is not correct.
Please advise how to implement the idea correctly. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question