[PEAR][HTML_QuickForm] Deux formulaires à la suite
Salut,
j'ai créé un petit formulaire tout simple, avec simplement 2 btn radio, et quand on clique sur le btn Envoyer, ça valide le formulaire, et ça arrive sur un second formulaire.
Le hic, c'est que quand on arrive sur le 2nd formulaire, celui-ci est déjà validé.. du coup je sais pas trop comment faire ?
voilà un exemple du code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
$form = new HTML_QuickForm('frmQuestion', 'post', 'index.php&id=2');
$form->addElement('radio', 'choix', 'Vous etes:', 'Un candidat', 'candidat');
$form->addElement('radio', 'choix', '', 'Une entreprise', 'entreprise');
$form->addElement('submit', 'bouton_envoyer', 'OK');
if ($form->validate()) {
$form = new HTML_QuickForm('frmInfos', 'post', 'index.php?id=2');
$form->addElement('text', 'Fnom', 'Nom');
$form->addElement('text', 'Fprenom', 'Prenom');
$form->addElement('text', 'Femail', 'Email');
$form->addElement('text', 'Fobjet', 'Objet');
$form->addElement('submit', 'bouton_envoyer', 'OK');
if ($form->validate()) {
echo "OK";
}else{
$form->display();
}
}else{
$form->display();
} |
Vu mon code c'est un peu normal que ça ne marche pas, mais je vois pas comment faire d'autre..