/** * Creates Form for Opting in * * @return \Nette\Application\UI\Form */ protected function createComponentOptInForm() { $form = new \Nette\Application\UI\Form(); $form->addProtection('Vypršel časový limit, odešlete formulář znovu'); $form->addAntispam(); $form->addText('name', 'Jméno a Příjmení:')->setRequired('Vložte jméno.'); $form->addText('mail', 'E-mail:')->addRule(\Nette\Application\UI\Form::EMAIL, 'Musí se jednat o platný e-mail.')->setRequired('Vložte e-mail.'); $form->addText('phone', 'Telefon:')->setRequired('Vložte telefonní číslo'); $form->addText('school', 'Škola:'); $form->addText('class', 'Třída:'); $form->addSubmit('send', 'Nezávazně se přihlásit'); $form->onSuccess[] = $this->optInFormSucceeded; return $form; }