Thank for your reply,
I changed code and leightbox shows ok. But I have some detail questions:
Question 1: I have to manual assign element to theme? How to assign automatic as column(row) theme?
Question 2: An element with required rule, how rule element'is assigned here?
Question 3: I want to validate at client, I call validate_form_name on click submit, but undefined error.
document.tpl theme
<center>
<BR>
<table>
<tr>
<td>
{$form_open}
<table cellpadding="0" style="width:550px; border-spacing: 3px;">
<tr>
<td class="epesi_label" style="width:13%;">
{$form_area.label}
</td>
<td class="epesi_data" style="width:53%;">
<div style="position: relative;">
{$form_area.error} // Question 2: How rule element'is assigned here?
{$form_area.html}
</div>
</td>
</tr>
<tr>
<td>
</td>
<td>
{$form_submit.html}
</td>
</tr>
</table>
{$form_close}
</td>
</tr>
</table>
</center>
public function new_form($prompt_id)
{
$form = & $this->init_module('Libs/QuickForm');
$theme = Base_ThemeCommon::init_smarty();
$area = $form->addElement('text','area',__('Area'));
$form->addRule('area', 'Required', 'required', null, 'client'); //An element with required rule
// Question 1: I have to manual assign element to theme? How to automatic assign as column(row) theme?
$theme->assign('form_area', array(
'label'=>__('Area'),
'html'=>$area->toHtml()
));
// Question 3: I want to validate at client, I call validate_form_name on click submit, but undefined error.
$submit = $form->addElement('submit', 'add_new', 'Add', array('onclick'=>'validate_' . $form->get_name(). '(frm)'. ';leightbox_deactivate("'.$prompt_id.'")'));
$theme->assign('form_submit', array(
'html'=>$submit->toHtml()
));
if($form->validate())
{
$values = $form->exportValues();
print_r($values);
}
$form->add_error_closing_buttons();
$form->assign_theme('form', $theme);
ob_start();
Base_ThemeCommon::display_smarty($theme,'Custom_Document','document');
$profiles_out = ob_get_clean();
return $profiles_out;
}