pb de soumission formulaire
Bonjour,
J'ai effectué un formulaire d'ajout des utilisateur.
Voilà le code de mon zend_form(ajouterutilisateur):
Code:
1 2 3 4 5 6 7 8
|
$group = new Zend_Form_Element_MultiCheckbox('groups');
$group->setLabel('Groups');
$groups = new Application_Model_DbTable_Groupe();
$groupsRows = $groups->fetchAll();
foreach ($groupsRows as $groupsRow ){
$group->addMultiOption($groupsRow->id_groupe,$groupsRow->groupe_nom ); } |
dans mon controleur:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
public function ajouterAction()
{ $this->_helper->layout->disableLayout();
$form = new Application_Form_AjoutUser();
$form->submit->setLabel('Add');
$this->view->formUser = $form;
if ($this->getRequest()->isPost()) {
$formData = $this->getRequest()->getPost();
if ($form->isValid($formData)) {
$nom = $form->getValue('nom');
$genre= $form->getValue('genre');
$username = $form->getValue('username');
$password= $form->getValue('password');
$email= $form->getValue('email');
$tel = $form->getValue('tel');
$societe = $form->getValue('societe');
$position = $form->getValue('position');
$type_user= $form->getValue('type_user');
$groupe_liste = $form->getValue('group');
$active = $form->getValue('active');
$date = $form->getValue('date');
$utilisateur = new Application_Model_DbTable_Utilisateur ();
$utilisateur->addUtilisateur($nom,$genre,$username,$password,$email,$tel,$societe,$position,$groupe_liste,$type_user,$active,$date);
$this->_helper->redirector('index');
} else {
$form->populate($formData);
}
}
} |
mais quand je clique sur le button ajouter le problème suivant se declenche:
Message: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'idgroupe' cannot be null
S'il vous plait ,pouvez vous m'aider.
Merci.