Yii Framework Forum: make form can change model ( I think) - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

make form can change model ( I think) how to make form can be adjust follow the request Rate Topic: -----

#1 User is offline   garry 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 28
  • Joined: 10-January 10

Posted 03 May 2011 - 05:25 AM

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?

#2 User is offline   kokomo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 289
  • Joined: 23-July 10

Posted 03 May 2011 - 05:55 AM

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

#3 User is offline   experia007 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 17-April 11

Posted 08 May 2011 - 10:42 AM

I have the same problem..

How to solve?

#4 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 08 May 2011 - 01:09 PM

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.

- Extension: Dynamic DataProvider Behavior
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.

- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing

#5 User is offline   ressaince 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 163
  • Joined: 10-January 11
  • Location:Jakarta

Posted 09 May 2011 - 08:01 AM

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.
take it or leave it

Share this topic:

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users