php - Text field or dropdown list in yii
I have two tables:supa and acts. Supa table has ID as primary key and and Acts table has supa_ID as a foreign key that is connecting this tables. Now in table Supa I has field that is called "oznaka". I suppose to create text field where I will put "oznaka", but in background it is suppose to take ID of Supa table, connect with table Acts, find supa_ID and put him there. I have troubles with controller function - I suppose I use view - controller only. This doesn't suppose to be hard but I have really trouble :(
Answer
Solution:
This is basic usage in Yii to create dropdown list, populated from database. If You want text box, You can make ajax call after some input is received to check whether in database is something that corresponds to this input. If there is, add new value to some hidden input field and get that data when form is sumbitted, in controller.