0

I need help. I have page with 4 combo boxes. Now, I need to make on same page one extra text field. I have two tables. Now the user can input into that text field something from table A, and that data suppose to go into table B. Table A and B are related.

well:

TABLE A:         
======== 
ID   Mark             
1    AA                
2    BB                
3    CC                
.    .                  
.    .                 

TABLE B:
========
A_ID
1
2
3
.
.
1
  • Please add more information so we can help you, like table columns, etc. Commented Mar 29, 2013 at 13:48

1 Answer 1

1

The exact way you shall implement it depends on the relation type, i.e. BELONGS_TO or HAS_MANY?

A good way to start with is to create a new form model extending from CFormModel; here you can define attributes from both A and B models, along with any additional attributes you may need, and their relevant validation rules.

Your controller would then process the request separating the received data into separate target models for saving, updating, etc.

Let me know if you need any specific example or clarification.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.