I want to create a form with several questions and answers for each question .Upon form submission I want to save each question and it’s answers into the database.
Is there a way to implement this, using CHtml::activeTextArea, (basically I want to be able to insert something like this: Question[0][answer][0][name] into the input field name using question and answer models)?
Surely it is possible. But this has nothing to with yii rather with plain php. Just think of a appropriate delimiter to separate your Question and Answer. The php function explode will than save the parts in an array. Each line of the textarea could be looped through with an foreach loop.
But don’t you think it is easier to use one textarea for the question and one for the answer?
I want to create a quiz add page. There I want to be able to insert the quiz name, and multiple questions each question having multiple answers . I could have done this with inserting simple html input fields: