Re: QuickForm and multiple occurences
| From: | Bertrand Mansion | Date: | Tue, 18 Mar 2003 12:09:47 +0000 |
| Subject: | Re: QuickForm and multiple occurences | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4288@lists.php.net to get a copy of this message | ||
<xav@spotk.net> wrote :
> Hello all,
> i'me currently working on a project where i have to display mutliples
> quickform on pages: the schema is like that :
>
> page1 - QuickForm1 => submit => page2 - QuickForm2 => submit ...
>
> the first page contains a very simple form without validation rules:
>
> $form = new HTML_QuickForm('form1','POST', 'page2.php');
> $form->addElement(...);
> $form->display();
>
>
> The second page have an other Form wich get hidden values from the first
> one and have rules in it :
>
> $form = new HTML_QuickForm('form2','POST', 'page3.php');
> $form->addElement(...);
> $form->addElement('hidden', ...);
> $form->addElement('submit',...);
> $form->addRule(...);
>
> if ($form->validate()){
> action;
> } else {
> $form->display();
> }
>
>
> My problem is when i submit the first Form to the second page , the
> second form directly try to validate before i submit it, i can't get a
> first display state without rules checking before the second submit.
>
> The only solution i've found is to unset($_POST) before instantiating
> QuickForm in the second page... Is it a normal behaviour ?
Hi,
You'd rather post your form to the same page and use header('Location: ');
if the form is valid.
Good luck,
Bertrand Mansion
Mamasam