forms with "more" functionality

Hi,

I have a table ‘tableA’ which has several fields ‘fieldA’, ‘fieldB’, ‘fieldC’, ‘fieldD’. The table also has the field ‘tableBId’, which references the field ‘id’ of the table ‘tableB’. I have several table of this kind, all referencing tableB. Since I want the user to be able to fill out the forms in one page I tried making a form.php with


return array(

  'elements'=>array(

    'tablea'=>array(

      'type'=>'form',

      'title'=>'Form tableA',

      'elements'=>array(

        'fieldA'=>array(

          'type'=>'text',

          'label'=>'fieldA',

        ),

        'fieldB'=>array(

          'type'=>'text',

          'label'=>'fieldB',

        ),

        'fieldC'=>array(

          'type'=>'text',

          'label'=>'fieldC',

        ),

        'fieldD'=>array(

          'type'=>'text',

          'label'=>'fieldD',

        ),

      ), 

    ),


    'tablec'=>array(

      'type'=>'form',

      'title'=>'Form tableA',

      'elements'=>array(

        'fieldA'=>array(

          'type'=>'text',

          'label'=>'fieldA',

        ),

        'fieldB'=>array(

          'type'=>'text',

          'label'=>'fieldB',

        ),

        'fieldC'=>array(

          'type'=>'text',

          'label'=>'fieldC',

        ),

        'fieldD'=>array(

          'type'=>'text',

          'label'=>'fieldD',

        ),

      ), 

    ),

  ),

  

  'buttons'=>array(

    'register'=>array(

      'type'=>'submit',

      'label'=>'Register',

    ),

  ),

 );

My question is now: the user is allowed to have as many tableA-objects as he wants. Is it possible to add something like a ‘more’-button? So that he gets a new form while the already filled in data is saved?

thanks,

schlydi

You can implement relations() method in Model and then render out to form view via CActiveForm, so User can fill many A follow one B for example. When user submit all will be saved. Just an idea, hope that help.