Hi,
I use LeightBox, with QuickForm, smarty.
It's ok if an autoselect element's added by call addElement.
But when I create an element and call addGroup, ajax will duplicate(twice call)
$form = $this->init_module('Libs/QuickForm');
$theme = Base_ThemeCommon::init_smarty();
$form->addElement('text', 'money_amount', __('Money Amount'));
$form->addElement('autoselect', 'material_test', _M('Material'), array(), array(array('MaterialCommon','material_suggestbox'), array(array(), array(), array('MaterialCommon', 'material_format'))), array('MaterialCommon', 'material_format')); This's OK, not duplicate
$details = array();
for($i = 0; $i < 5; $i++)
{
$row = array();
$row[]=$form->createElement('text', 'item['.$i.'][name]', __('Name'));
$row[]=$form->createElement('checkbox', 'item['.$i.'][amount]', __('Name'));
$row[] = $form->createElement('autoselect', 'item['.$i.'][material]', _M('Material'), array(), array(array('MaterialCommon','material_suggestbox'), array(array(), array(), array('MaterialCommon', 'material_format'))), array('MaterialCommon', 'material_format'));
$details[] = $form->addGroup($row);
}
$submit = $form->addElement('submit', 'submit', 'Submit', array('onclick'=>'leightbox_deactivate("'.$prompt_id.'");'.$form->get_submit_form_js(true)));
$form->assign_theme('form',$theme);
ob_start();
Base_ThemeCommon::display_smarty($theme,'Acceptance','default');
$profiles_out = ob_get_clean();
return $profiles_out;
![5-20-2014 2-47-06 PM.jpg](http://i.imgur.com/Q8zyo6P.jpg)