Mathematique
$form=new Formulaire("formulaire.php");
$fields=array(
""=>array("type"=>"comment", "name"=>"entete", "value"=>"
(*) Champs obligatoires"), "Civilité"=>array("type"=>"radio", "name"=>"civil", "label"=>"1", "valuesRadio"=>array("Mme", "Mlle", "Mr"), "checkedRadio"=>"2"), "Nom"=>array("type"=>"text", "label"=>"1", "name"=>"nom", "required"=>"1"), "Email"=>array("type"=>"email", "label"=>"1", "name"=>"email", "required"=>"1"), "Code Postal"=>array("type"=>"text", "label"=>"1", "name"=>"cp"), "Téléphone"=>array("type"=>"phone", "label"=>"1", "name"=>"tel", "required"=>"1"), "Objet"=>array("type"=>"list", "label"=>"1", "name"=>"objet", "required"=>"1", "valuesList"=>array("Option 1", "Option 2"), "selectedList"=>"1"), "Message"=>array("type"=>"textarea", "label"=>"1", "name"=>"msg"), "Captcha"=>array("type"=>"captcha", "label"=>"1", "name"=>"captcha", "required"=>"1"), "Envoyer"=>array("type"=>"submit", "name"=>"submit") ); $form->setTabFields($fields); $form->createForm(); $tabValidated = $form->verifValidate(); if($tabValidated) { //TRAITEMENT DES INFOS var_dump($tabValidated); } echo $form->getMsg(); echo $form->displayForm();
(*) Champs obligatoires"), "Civilité"=>array("type"=>"radio", "name"=>"civil", "label"=>"1", "valuesRadio"=>array("Mme", "Mlle", "Mr"), "checkedRadio"=>"2"), "Nom"=>array("type"=>"text", "label"=>"1", "name"=>"nom", "required"=>"1"), "Email"=>array("type"=>"email", "label"=>"1", "name"=>"email", "required"=>"1"), "Code Postal"=>array("type"=>"text", "label"=>"1", "name"=>"cp"), "Téléphone"=>array("type"=>"phone", "label"=>"1", "name"=>"tel", "required"=>"1"), "Objet"=>array("type"=>"list", "label"=>"1", "name"=>"objet", "required"=>"1", "valuesList"=>array("Option 1", "Option 2"), "selectedList"=>"1"), "Message"=>array("type"=>"textarea", "label"=>"1", "name"=>"msg"), "Captcha"=>array("type"=>"captcha", "label"=>"1", "name"=>"captcha", "required"=>"1"), "Envoyer"=>array("type"=>"submit", "name"=>"submit") ); $form->setTabFields($fields); $form->createForm(); $tabValidated = $form->verifValidate(); if($tabValidated) { //TRAITEMENT DES INFOS var_dump($tabValidated); } echo $form->getMsg(); echo $form->displayForm();