Add inputs to a complex form array using foreach loop

Badshot

New Member
I'm using a foreach to get membership level information:\[code\] foreach ($aMemLevels as $aMemLevel) { // Add 'mlevels' array to $aForm['inputs'] array }\[/code\]I have a main form variable that hold a large array: $aFormThe form is setup like this: \[code\]$aForm = array( 'form_attrs' => array( 'name' => 'menu_access', 'action' => BX_DOL_URL_ROOT.'m/memberships/main_menu', 'method' => 'post', 'onsubmit' => 'saveMenuItem(this); return false;' ), 'inputs' => array( 'mlevels' => array( 'type' => 'checkbox', 'caption' => 'Check to enable', 'name' => '1', 'value' => '1', ), ),);\[/code\]I am trying to find a way to add an "mlevels" array to the \[code\]$aForm['inputs']\[/code\] array, for each iteration of $aMemLevels.
 
Back
Top