defaultRenderer(); $renderer->setFormTemplate('{content}
'); $renderersetCustomElementTemplate->setCustomElementTemplate('{element}'); $form->addElement('html', $option1); $form->addElement('checkbox', 'left', null, get_lang('Yes')); $form->addElement('button', 'submit', get_lang('Confirm'), ['class' => 'btn btn-primary']); $formHtml = $form->returnForm(); if ($form->validate()) { $result = $form->getSubmitValues(); if (isset($result['left']) && $result['left']) { $_SESSION['before_login_accepted'] = 1; header('Location: '.$urlOption1); exit; } } $form2 = new FormValidator('form'); if (!empty($option2) && !empty($urlOption2)) { $renderer = &$form2->defaultRenderer(); $renderer->setHeaderTemplate(''); $renderer->setFormTemplate('{content}
'); $renderer->setCustomElementTemplate('{element}'); $form2->addElement('html', $option2); $form2->addElement('checkbox', 'right', null, get_lang('Yes')); $form2->addElement('button', 'submit', get_lang('Send message')); $formHtml2 = $form2->returnForm(); if ($form2->validate()) { $result = $form2->getSubmitValues(); if (isset($result['right']) && $result['right']) { header('Location: '.$urlOption2); exit; } } } $_template['form_option1'] = $formHtml; $_template['form_option2'] = $formHtml2; }