QuickForm and multiple occurences
| From: | xavier Lembo | Date: | Tue, 18 Mar 2003 11:57:26 +0000 |
| Subject: | QuickForm and multiple occurences | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-4287@lists.php.net to get a copy of this message | ||
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 ?
Thanks .
regards
--
Xavier