This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.2 » sfValidatorChoice invalid - (WITH multiple true)
sfValidatorChoice invalid - (WITH multiple true) [message #98147] Tue, 27 April 2010 15:22 Go to next message
Bloodkiller99  is currently offline Bloodkiller99
Messages: 17
Registered: April 2010
Location: Toulouse
Junior Member
Hello

i'm working on a project and i need the users to select all the drivers licences they have so i made This:

  
//BASEmymoduleForm.class.php
	  $choices = array(
 		 'Permis A' => array('A-A1' => 'A1', 'A-A' => 'A'),
 		 'Permis B' => array('B-B1' => 'B1', 'B-B' => 'B'),
		 'Permis C' => array('C-C' => 'C'),
		 'Permis D' => array('D-D' => 'D'),
		 'Permis E' => array('E-B' => 'B', 'E-C' => 'C', 'E-D' => 'D'),
	  );
  $this->setWidgets(array(
//others widgets
 'permis' => new sfWidgetFormChoice(array('choices' => $choices,'multiple' => true,'expanded' => true)),
));

//AND MY VALIDATORS 

  $this->setValidators(array(

//others validators
'permis'                    => new sfValidatorChoice(array('choices' => $choices,'multiple' => true)),
));



ANd when i fill my form it says 'invalid'

why ? did i do something wrong ? my DB stocks the permis field in varchar255 !

Thanks for Your answers

David.


--------------------------------------
----------- 318 i - e30 ------------
--------------------------------------
Re: sfValidatorChoice invalid - (WITH multiple true) [message #98412 is a reply to message #98147 ] Sun, 02 May 2010 21:57 Go to previous messageGo to next message
lkrubner  is currently offline lkrubner
Messages: 297
Registered: July 2008
Location: Virginia, USA
Faithful Member
Hmm, just out of curiosity, does it work if you take out the

multipe => 'true'

???



Symfony Experts offers answers: http://www.symfonyexperts.com/
Re: sfValidatorChoice invalid - (WITH multiple true) [message #98424 is a reply to message #98147 ] Mon, 03 May 2010 09:14 Go to previous message
Bloodkiller99  is currently offline Bloodkiller99
Messages: 17
Registered: April 2010
Location: Toulouse
Junior Member
No it doesn't work and it gives me an error message that tell me I have to remove the expanded option on the validator !

After that i have radio buttons so this is not what i want...(i want checkboxes)

Thanks anyway ! Razz


--------------------------------------
----------- 318 i - e30 ------------
--------------------------------------
Previous Topic:can the request from a form be sent to the action of components?
Next Topic:slot / partial / or component for container div
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software