Tranfering form which is created in foreach loop

Hey guys, I've got a problem with a form. I created function which make a form in foreach loop, code is below:

 

Function

function genForm($iId) {

       

        $aForm = array(

            'form_attrs' =>array(

                'name' => 'add_friend_to_event',

                'action' => '',

                'method' => 'post',

 

            ),

 

            'params' => array (

                'db' => array(

                    'table' => 'events_users',

                    'key' => 'id',

                    'submit_name' => 'submit_form',

                ),

            ),

 

            'inputs' => array(

                'nickname' => array(

                    'type' => 'text',

                    'name' => 'id_participant',

                    'db' => array(

                        'pass' => 'text'

                    ),

                ),

 

                'id_event' => array(

                    'type' => 'text',

                    'name' => 'id_event',

                    'value' => $iId,

 

                ),

 

                'submit' => array(

                    'type' => 'submit',

                    'name' => 'submit_form',

                    'value' => _t('_Submit'),

                    'colspan' => true,

                )

            )

        );

 

        $oForm = new BxTemplFormView($aForm);

        $oForm->initChecker();

        $echo = $oForm->getCode();

        return $echo;

    }

 

And here is a loop;


 foreach ($aEvents as $sKey => $aRow) { 

            $iId = $aEvents[$sKey]['Id'] = $aRow['Id'];

            $form['code'] = $this->genForm($iId);

            var_dump ($form);

}
 
 
 
On my page var_dump shows good looking forms with correct id value in input, but when I put array $form into aVars like this: 

$aVars = array (
            'history',
            'bx_repeat:posts' => $aEvents,
            'bx_repeat:form' => $form,
        );
 
and html file like this:
 
        <table>
            <tr>
                <td>Add friend</td>
            </tr>
            <bx_repeat:form>
            <tr>
                <td>__code__</td>
            </tr>
            </bx_repeat:form>
        </table>
 
nothing happens on page, I have not any form. 
 
So, my question is, how to transfer all forms from foreach loop and put them into table?
Quote · 20 May 2014

Original Post here: http://www.boonex.com/forums/?action=goto&my_threads=1#topic/Form-with-a-variable-value-in-hidden-input.htm

caredesign.net
Quote · 21 May 2014

New post is with new topic name, beacause old was not precise, I think. So, maybe you have any other solution? I tried yours, and it didn't work.

Quote · 21 May 2014

again - without seeing the full page code it is almost impossible to help you. Which is probably why you have not gotten any accurate answers.

caredesign.net
Quote · 23 May 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.