I used QuickForm in lightbox, it show all ok, with required rule.
Please help me, I want to validate form on submit(button) and show errors occurs, if all valid then close lightbox
$form = ModuleManager::new_instance('Libs_QuickForm', null, 'sampleform');
$form->construct();
$form->addElement('datepicker', 'deploymentdate', _M('Deployment Date'), array('id'=>'deploymentdate'));
$form->addRule('deploymentdate', 'error_message', 'required');
$ok = $form->createElement('submit', 'submit', __('Confirm'), array('onclick'=>'leightbox_deactivate("'.$prefix.'")'));
$cancel = $form->createElement('button', 'cancel', __('Cancel'), array('onclick'=>'leightbox_deactivate("'.$prefix.'")'));
$form->addGroup(array($ok, $cancel));
if($form->validate()) {
$Uvalues = $form->exportValues();
}
$form->add_error_closing_buttons();
$html = $form->toHtml();
Libs_LeightboxCommon::display($prefix, $html);