Group, I was recently trying to build a form in Symfony v 2.0.12 without this related to a class. Follow the instructions on the direction http://symfony.com/doc/current/book/forms.html "Using a Form without a Class ". I validation works correctly in elements of type "text" and "textarea" but "choice" no. If you display the messages in these elements must exist an element but at the time of registration is $ form.isValid () where it enters and shows no error message. If anyone can help me with this issue or suggest a link thanks in advance. I copy here a piece of code used
/** * Formulario no asociado a ninguna clase */ private function formulario() { $collectionConstraint = new Collection(array( 'origen' => new NotBlank(), 'titulo'=> new NotBlank(), 'descripcion' => new NotBlank(), 'destinatarios' => new NotBlank(), )); // Forms sin clase $form = $this->createFormBuilder(null, array( 'validation_constraint' => $collectionConstraint, )) ->add('origen', 'text') ->add('titulo', 'text') ->add('descripcion', 'textarea') ->add('destinatarios', 'choice', array( 'multiple' => true, 'required' => true, // 'expanded' => true, )) ->getForm(); return $form; } // Crear el formulario $form = $this->formulario(); if ($request->getMethod() == 'POST') { $form->bindRequest($request); // Examinar los elementos recuperados $data = $form->getData(); echo count($data['destinatarios']); if ($form->isValid()) { echo 'formulario valido!:<br>'; ---------------> here is where you do not enter -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to symfony-devs@googlegroups.com To unsubscribe from this group, send email to symfony-devs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en