Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $form = new Form;
- $form->action='?1';
- $form->getElementPrototype()->novalidate = "novalidate";
- $cont = $form->addContainer('first');
- $cont->addText('name', 'Your name:')
- ->setRequired('Enter your name');
- $cont->addHidden('a', 1);
- $cont->addSubmit('submit', 'Send');
- $form2 = new Form;
- $form2->action='?2';
- $form2->getElementPrototype()->novalidate = "novalidate";
- $cont = $form2->addContainer('second');
- $cont->addText('name', 'Your name 2:')
- ->setRequired('Enter your name');
- $cont->addHidden('b', 1);
- $cont->addSubmit('submit2', 'Send');
- if ($form->isSuccess() && $_POST['first']['a']) {
- echo '<h2>Form was submitted and successfully validated</h2>';
- Dumper::dump($form->getValues(), [Dumper::COLLAPSE => FALSE]);
- }
- if ($form2->isSuccess() && $_POST['second']['b']) {
- echo '<h2>Form2 was submitted and successfully validated</h2>';
- Dumper::dump($form->getValues(), [Dumper::COLLAPSE => FALSE]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement