make form can change model ( I think)

this scenario like this.

tbl_client                    tbl_partner_employee    tbl_partner_business

id(PK)                        id(PK)                  id(PK)

name                          job_company             business_company

address                       position                business_field





the form is like this:


address: textfield

partner_name: textfiled

job : dropdownlist consist employee and business

when employee dropdownlist job is select, the form tabel partner_employee is show up, and vice versa.

how I can make it?

I have read forum for 2 days and never get the answer, there is nested forum and it look like need save the form 1st then save 2nd form which I want save all form at once and dynamic form that I don,t understand.

or maybe I just put in all field in 1 table and make some filter to show up the field that I want?

but what the code?

Maybe the Tutorial How to use a single form to collect data from two or more models is helpful for you.

I have the same problem…

How to solve?

Not sure if this is what you are asking for?

maybe you guys could try the Yii Chat if you didnt get an answer in the forum.

you can use JQuery to manipulate your page…

read the JQuery manual…

you can perform ajax when the dropdownlist is changed easily with jquery.

if you want have dynamic field you can perform $(".container").clone();

and put it in you page…

remember the textField name must be an array like ‘name[]’

i’m not use my notebook now so i can’t give you a example code.