Zend FR

Consultez la FAQ sur le ZF avant de poster une question

Vous n'êtes pas identifié.

#1 04-05-2014 17:10:32

daverck
Membre
Date d'inscription: 14-09-2009
Messages: 30

[Résolu][Zend_Form][ formulaire qui ne vérifie pas la fonction isValid

Bonjour,

J'ai un formulaire qui une fois remplit ne vérifie jamais la fonction $form->isValid($_POST)

Voilà le long formulaire

Code:

[lang=php]
<?php

class Default_Form_Exercice10 extends Zend_Dojo_Form
{

    
    public function init()
    {
        // Set the method for the form to POST
        $this->setDescription("exercice10 saving form")
             ->setEnctype(Zend_Dojo_Form::ENCTYPE_URLENCODED)
             ->setName("exercice10_form")
             ->setAction('')
             ->setMethod('post');
        
        // for translation
        //$translate = Zend_Registry::get('translate');
        
        //creating subforms
        $exercice10_subform0 = new Zend_Dojo_Form_SubForm();
        $exercice10_subform1 = new Zend_Dojo_Form_SubForm();
        $exercice10_subform2 = new Zend_Dojo_Form_SubForm();
        $exercice10_subform3 = new Zend_Dojo_Form_SubForm();
        $exercice10_subform4 = new Zend_Dojo_Form_SubForm();
        $exercice10_subform5 = new Zend_Dojo_Form_SubForm();
        $exercice10_subform6 = new Zend_Dojo_Form_SubForm();
        $exercice10_subform7 = new Zend_Dojo_Form_SubForm();
        $exercice10_subform8 = new Zend_Dojo_Form_SubForm();
        $exercice10_subform9 = new Zend_Dojo_Form_SubForm();
        $exercice10_subform10 = new Zend_Dojo_Form_SubForm();
        
        // Association of subform with the form :
        $this->addSubForm($exercice10_subform0,
                'exercice10_subform0',
                0
        );
        // Association of subform with the form :
        $this->addSubForm($exercice10_subform1,
                'exercice10_subform1',
                1
        );
        // Association of subform with the form :
        $this->addSubForm($exercice10_subform2,
                'exercice10_subform2',
                2
        );
        // Association of subform with the form :
        $this->addSubForm($exercice10_subform3,
                'exercice10_subform3',
                3
        );
        // Association of subform with the form :
        $this->addSubForm($exercice10_subform4,
                'exercice10_subform4',
                4
        );
        // Association of subform with the form :
        $this->addSubForm($exercice10_subform5,
                'exercice10_subform5',
                5
        );
        // Association of subform with the form :
        $this->addSubForm($exercice10_subform6,
                'exercice10_subform6',
                6
        );
        // Association of subform with the form :
        $this->addSubForm($exercice10_subform7,
                'exercice10_subform7',
                7
        );
        // Association of subform with the form :
        $this->addSubForm($exercice10_subform8,
                'exercice10_subform8',
                8
        );
        // Association of subform with the form :
        $this->addSubForm($exercice10_subform9,
                'exercice10_subform9',
                9
        );
        // Association of subform with the form :
        $this->addSubForm($exercice10_subform10,
                'exercice10_subform10',
                10
        );
        
        
        ////////////////////////////
        // exercice10 elements    //
        ////////////////////////////
        
        // Add a save button
        $this->addElement('submit', 'exercice10_submit', array(
                                                    'ignore'       => true,
                                                    'label'     => 'Save',
                                                    'class'        => 'static')
                        );
                        
//        // And finally add some CSRF protection
//        $this->addElement('hash', 'exercice10_csrf', array(
//                                                'ignore' => true
//                                                    )
//                        );

                
        
        
        // Add a exercice name element
        $exercice10_subform0->addElement('validationTextBox', 'exercice_name', array(
                'label'      => 'exercice name :',
                'required'   => true,
                'filters'    => array('StripTags',
                'StringTrim'),
                'regExp'         => '^[\sa-zA-Z0-9_-]{1,250}$',
                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                'invalidMessage' => 'Invalid exercice name must be between 1 and 250 alphanumeric characters',
                'promptMessage'    => 'Enter your exercice name',
                'id'            => 'exercice_name',
                'class'            => 'static'
        ),
                array()
        );
            
        // Add a exercice about element
        $exercice10_subform0->addElement('Textarea', 'exercice_about', array(
                'label'      => 'Short description :',
                'required'   => true,
                'filters'    => array('StripTags',
                        'StringTrim',),
                'validators' => array(array('StringLength', false, array(1, 250))),
                'ErrorMessages' => array('more'=>'Element requis'),
                'invalidMessage' => 'Description must be under 250 characters',
                'promptMessage'    => 'Describe the exercice',
                'id'            => 'exercice_about',
                'class'            => 'static'
        )
        );
        
        // Add a exercice update type element
        $exercice10_subform0->addElement('ComboBox', 'exercice_update_type', array(
                'label'      => 'Type of edition :',
                'required'   => true,
                'value'        => 'original',
                'autocomplete' => true,
                'multiOptions' => array('original'    => 'original',
                        'normal'    => '$translate->_("Update")',
                        'minor'   => '$translate->_("Minor update")',),
                'ErrorMessages' => array('required'=>'Element requis'),
                'promptMessage'    => 'Enter gender',
                'id'            => 'exercice_update_type',
                'class'            => 'static',
                'invalidMessage' => 'Invalid type',
        )
        );
         
        // Add a exercice update comment element
        $exercice10_subform0->addElement('Textarea', 'exercice_update_comment', array(
                'label'      => 'Comment the modification :',
                'required'   => true,
                'filters'    => array('StripTags',
                        'StringTrim',),
                'validators' => array(array('StringLength', false, array(0, 250)),),
                'ErrorMessages' => array('more'=>'Element requis'),
                'invalidMessage' => 'Description must be under 250 characters',
                'promptMessage'    => 'Explain the work just done',
                'id'            => 'exercice_update_comment',
                'class'            => 'static'
        )
        );
        
        // Add a term of service agreement
        $exercice10_subform0->addElement('checkbox', 'exercice_agreement', array(
                'label'      => 'Check this box to accept the terms of service :',
                'required'   => true,
                'ErrorMessages' => array('required'=>'Element requis'),
                'promptMessage'    => 'Check this box to accept the terms of service',
                'id'            => 'exercice_agreement_term',
                'class'            => 'static',
                'uncheckedValue' => ""
        )
        );
         
        
        // Add a hidden exercice content element
        $exercice10_subform0->addElement('hidden', 'exercice_content', array(
                'required'   => true,
                'filters'    => array('StripTags'),
                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                'invalidMessage' => 'Invalid exercice content must be at least 100 caracters',
        'id'            => 'exercice_content',
                'class'            => 'static',
                'value'            => 'exercice_content_value'
        )
        );
                 
                // Add a hidden category id
                $exercice10_subform0->addElement('hidden', 'exercice_category_id', array(
        'required'   => true,
        'validators' => array('Digits'),
        'filters'    => array('StripTags'),
                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                'invalidMessage' => 'Invalid exercice content must be at least 100 caracters',
                'id'            => 'exercice_category_id',
                'class'            => 'static'
                )
                );
                 
                //         $exercice10_subform0->addElement('hidden', 'exercice_id', array(
                //                                                 'required'   => true,
                //                                                 'validators' => array('Digits'),
//                                                 //'filters'    => array('StripTags'),
//                                                 'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                //                                                 'invalidMessage' => 'Invalid exercice content must be at least 100 caracters',
                //                                                 'id'            => 'exercice_category_id',
                //                                                 'class'            => 'static'
                //                                         )
                //                         );
                
                

        //First question :
        // Add a exercice10 name element
        $exercice10_subform1->addElement('validationTextBox', 'exercice10 1-1', array(
                                                'label'      => 'exercice 1 response 1 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_1-1',
                                                'class'            => 'static'
                                                    ),
                                                    array()
                            );
                            
        $exercice10_subform1->addElement('validationTextBox', 'exercice10 1-2', array(
                                                'label'      => 'exercice 1 response 2 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_1-2',
                                                'class'            => 'static'
                                                    ),
                                                    array()
                            );
                            
        $exercice10_subform1->addElement('validationTextBox', 'exercice10 1-3', array(
                                                'label'      => 'exercice 1 response 3 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_1-3',
                                                'class'            => 'static'
                                                    ),
                                                    array()
                            );

        $exercice10_subform1->addElement('validationTextBox', 'exercice10 1-4', array(
                                                'label'      => 'exercice 1 response 4 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_1-4',
                                                'class'            => 'static'
                                                    ),
                                                    array()
                            );

        $exercice10_subform1->addElement('validationTextBox', 'exercice10 1-5', array(
                                                'label'      => 'exercice 1 response 5 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_1-5',
                                                'class'            => 'static'
                                                    ),
                                                    array()
                            );
                            
                            
           // Add a Course answer element
        $exercice10_subform1->addElement('ComboBox', 'course_answer_1', array(
                                                'label'      => 'Answer :',
                                                'required'   => true,
                                                'value'        => '1',
                                                'autocomplete' => true,
                                                'multiOptions' => array('1'    => '1',
                                                                        '2'    => '$translate->_("2")',
                                                                        '3'    => '$translate->_("3")',
                                                                        '4'    => '$translate->_("4")',
                                                                        '5'    => '$translate->_("5")',),
                                                'ErrorMessages' => array('required'=>'Element requis'),
                                                'promptMessage'    => 'Enter answer',
                                                'id'            => 'course_answer_1',
                                                'class'            => 'static',
                                                'invalidMessage' => 'Invalid type',
                                                            )
                            );

        //Second question :
        // Add a exercice10 name element
        $exercice10_subform2->addElement('validationTextBox', 'exercice10 2-1', array(
                                                'label'      => 'exercice 2 response 1 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_2-1',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform2->addElement('validationTextBox', 'exercice10 2-2', array(
                                                'label'      => 'exercice 2 response 2 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_2-2',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform2->addElement('validationTextBox', 'exercice10 2-3', array(
                                                'label'      => 'exercice 2 response 3 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_2-3',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform2->addElement('validationTextBox', 'exercice10 2-4', array(
                                                'label'      => 'exercice 2 response 4 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_2-4',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform2->addElement('validationTextBox', 'exercice10 2-5', array(
                                                'label'      => 'exercice 2 response 5 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_2-5',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
           // Add a Course answer element
        $exercice10_subform2->addElement('ComboBox', 'course_answer_2', array(
                                                'label'      => 'Answer :',
                                                'required'   => true,
                                                'value'        => '1',
                                                'autocomplete' => true,
                                                'multiOptions' => array('1'    => '1',
                                                                        '2'    => '$translate->_("2")',
                                                                        '3'    => '$translate->_("3")',
                                                                        '4'    => '$translate->_("4")',
                                                                        '5'    => '$translate->_("5")',),
                                                'ErrorMessages' => array('required'=>'Element requis'),
                                                'promptMessage'    => 'Enter answer',
                                                'id'            => 'course_answer_2',
                                                'class'            => 'static',
                                                'invalidMessage' => 'Invalid type',
                                                            )
                            );                            
        //Third question :
        // Add a exercice10 name element
        $exercice10_subform3->addElement('validationTextBox', 'exercice10 3-1', array(
                                                'label'      => 'exercice 3 response 1 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_3-1',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform3->addElement('validationTextBox', 'exercice10 3-2', array(
                                                'label'      => 'exercice 3 response 2 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_3-2',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform3->addElement('validationTextBox', 'exercice10 3-3', array(
                                                'label'      => 'exercice 3 response 3 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_3-3',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform3->addElement('validationTextBox', 'exercice10 3-4', array(
                                                'label'      => 'exercice 3 response 4 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_3-4',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform3->addElement('validationTextBox', 'exercice10 3-5', array(
                                                'label'      => 'exercice 3 response 5 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_3-5',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );                            
                            
           // Add a Course answer element
        $exercice10_subform3->addElement('ComboBox', 'course_answer_3', array(
                                                'label'      => 'Answer :',
                                                'required'   => true,
                                                'value'        => '1',
                                                'autocomplete' => true,
                                                'multiOptions' => array('1'    => '1',
                                                                        '2'    => '$translate->_("2")',
                                                                        '3'    => '$translate->_("3")',
                                                                        '4'    => '$translate->_("4")',
                                                                        '5'    => '$translate->_("5")',),
                                                'ErrorMessages' => array('required'=>'Element requis'),
                                                'promptMessage'    => 'Enter answer',
                                                'id'            => 'course_answer_3',
                                                'class'            => 'static',
                                                'invalidMessage' => 'Invalid type',
                                                            )
                            );                            
                            
        //4th question :
        // Add a exercice10 name element
        $exercice10_subform4->addElement('validationTextBox', 'exercice10 4-1', array(
                                                'label'      => 'exercice 4 response 1 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_4-1',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform4->addElement('validationTextBox', 'exercice10 4-2', array(
                                                'label'      => 'exercice 4 response 2 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_4-2',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform4->addElement('validationTextBox', 'exercice10 4-3', array(
                                                'label'      => 'exercice 4 response 3 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_4-3',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform4->addElement('validationTextBox', 'exercice10 4-4', array(
                                                'label'      => 'exercice 4 response 4 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_4-4',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform4->addElement('validationTextBox', 'exercice10 4-5', array(
                                                'label'      => 'exercice 4 response 5 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_4-5',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );                            
                            
           // Add a Course answer element
        $exercice10_subform4->addElement('ComboBox', 'course_answer_4', array(
                                                'label'      => 'Answer :',
                                                'required'   => true,
                                                'value'        => '1',
                                                'autocomplete' => true,
                                                'multiOptions' => array('1'    => '1',
                                                                        '2'    => '$translate->_("2")',
                                                                        '3'    => '$translate->_("3")',
                                                                        '4'    => '$translate->_("4")',
                                                                        '5'    => '$translate->_("5")',),
                                                'ErrorMessages' => array('required'=>'Element requis'),
                                                'promptMessage'    => 'Enter answer',
                                                'id'            => 'course_answer_4',
                                                'class'            => 'static',
                                                'invalidMessage' => 'Invalid type',
                                                            )
                            );                            
                            
        //5th question :
        // Add a exercice10 name element
        $exercice10_subform5->addElement('validationTextBox', 'exercice10 5-1', array(
                                                'label'      => 'exercice 5 response 1 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_5-1',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform5->addElement('validationTextBox', 'exercice10 5-2', array(
                                                'label'      => 'exercice 5 response 2 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_5-2',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform5->addElement('validationTextBox', 'exercice10 5-3', array(
                                                'label'      => 'exercice 5 response 3 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_5-3',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform5->addElement('validationTextBox', 'exercice10 5-4', array(
                                                'label'      => 'exercice 5 response 4 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_5-4',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform5->addElement('validationTextBox', 'exercice10 5-5', array(
                                                'label'      => 'exercice 5 response 5 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_5-5',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );                            
                            
           // Add a Course answer element
        $exercice10_subform5->addElement('ComboBox', 'course_answer_5', array(
                                                'label'      => 'Answer :',
                                                'required'   => true,
                                                'value'        => '1',
                                                'autocomplete' => true,
                                                'multiOptions' => array('1'    => '1',
                                                                        '2'    => '$translate->_("2")',
                                                                        '3'    => '$translate->_("3")',
                                                                        '4'    => '$translate->_("4")',
                                                                        '5'    => '$translate->_("5")',),
                                                'ErrorMessages' => array('required'=>'Element requis'),
                                                'promptMessage'    => 'Enter answer',
                                                'id'            => 'course_answer_5',
                                                'class'            => 'static',
                                                'invalidMessage' => 'Invalid type',
                                                            )
                            );                            
        //6th question :
        // Add a exercice10 name element
        $exercice10_subform6->addElement('validationTextBox', 'exercice10 6-1', array(
                                                'label'      => 'exercice 6 response 1 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_6-1',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform6->addElement('validationTextBox', 'exercice10 6-2', array(
                                                'label'      => 'exercice 6 response 2 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_6-2',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform6->addElement('validationTextBox', 'exercice10 6-3', array(
                                                'label'      => 'exercice 6 response 3 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_6-3',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform6->addElement('validationTextBox', 'exercice10 6-4', array(
                                                'label'      => 'exercice 6 response 4 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_6-4',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform6->addElement('validationTextBox', 'exercice10 6-5', array(
                                                'label'      => 'exercice 6 response 5 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_6-5',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );                            
                            
           // Add a Course answer element
        $exercice10_subform6->addElement('ComboBox', 'course_answer_6', array(
                                                'label'      => 'Answer :',
                                                'required'   => true,
                                                'value'        => '1',
                                                'autocomplete' => true,
                                                'multiOptions' => array('1'    => '1',
                                                                        '2'    => '$translate->_("2")',
                                                                        '3'    => '$translate->_("3")',
                                                                        '4'    => '$translate->_("4")',
                                                                        '5'    => '$translate->_("5")',),
                                                'ErrorMessages' => array('required'=>'Element requis'),
                                                'promptMessage'    => 'Enter answer',
                                                'id'            => 'course_answer_6',
                                                'class'            => 'static',
                                                'invalidMessage' => 'Invalid type',
                                                            )
                            );                            
                            
        //First question :
        // Add a exercice10 name element
        $exercice10_subform7->addElement('validationTextBox', 'exercice10 7-1', array(
                                                'label'      => 'exercice 7 response 1 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_7-1',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform7->addElement('validationTextBox', 'exercice10 7-2', array(
                                                'label'      => 'exercice 7 response 2 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_7-2',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform7->addElement('validationTextBox', 'exercice10 7-3', array(
                                                'label'      => 'exercice 7 response 3 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_7-3',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform7->addElement('validationTextBox', 'exercice10 7-4', array(
                                                'label'      => 'exercice 7 response 4 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_7-4',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform7->addElement('validationTextBox', 'exercice10 7-5', array(
                                                'label'      => 'exercice 7 response 5 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_7-5',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

           // Add a Course answer element
        $exercice10_subform7->addElement('ComboBox', 'course_answer_7', array(
                                                'label'      => 'Answer :',
                                                'required'   => true,
                                                'value'        => '1',
                                                'autocomplete' => true,
                                                'multiOptions' => array('1'    => '1',
                                                                        '2'    => '$translate->_("2")',
                                                                        '3'    => '$translate->_("3")',
                                                                        '4'    => '$translate->_("4")',
                                                                        '5'    => '$translate->_("5")',),
                                                'ErrorMessages' => array('required'=>'Element requis'),
                                                'promptMessage'    => 'Enter answer',
                                                'id'            => 'course_answer_7',
                                                'class'            => 'static',
                                                'invalidMessage' => 'Invalid type',
                                                            )
                            );                            
                            
        //First question :
        // Add a exercice10 name element
        $exercice10_subform8->addElement('validationTextBox', 'exercice10 8-1', array(
                                                'label'      => 'exercice 8 response 1 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_8-1',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform8->addElement('validationTextBox', 'exercice10 8-2', array(
                                                'label'      => 'exercice 8 response 2 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_8-2',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform8->addElement('validationTextBox', 'exercice10 8-3', array(
                                                'label'      => 'exercice 8 response 3 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_8-3',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform8->addElement('validationTextBox', 'exercice10 8-4', array(
                                                'label'      => 'exercice 8 response 4 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_8-4',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform8->addElement('validationTextBox', 'exercice10 8-5', array(
                                                'label'      => 'exercice 8 response 5 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_8-5',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );                            
                            
           // Add a Course answer element
        $exercice10_subform8->addElement('ComboBox', 'course_answer_8', array(
                                                'label'      => 'Answer :',
                                                'required'   => true,
                                                'value'        => '1',
                                                'autocomplete' => true,
                                                'multiOptions' => array('1'    => '1',
                                                                        '2'    => '$translate->_("2")',
                                                                        '3'    => '$translate->_("3")',
                                                                        '4'    => '$translate->_("4")',
                                                                        '5'    => '$translate->_("5")',),
                                                'ErrorMessages' => array('required'=>'Element requis'),
                                                'promptMessage'    => 'Enter answer',
                                                'id'            => 'course_answer_8',
                                                'class'            => 'static',
                                                'invalidMessage' => 'Invalid type',
                                                            )
                            );                            
        //First question :
        // Add a exercice10 name element
        $exercice10_subform9->addElement('validationTextBox', 'exercice10 9-1', array(
                                                'label'      => 'exercice 9 response 1 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_9-1',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform9->addElement('validationTextBox', 'exercice10 9-2', array(
                                                'label'      => 'exercice 9 response 2 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_9-2',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform9->addElement('validationTextBox', 'exercice10 9-3', array(
                                                'label'      => 'exercice 9 response 3 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_9-3',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform9->addElement('validationTextBox', 'exercice10 9-4', array(
                                                'label'      => 'exercice 9 response 4 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_9-4',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform9->addElement('validationTextBox', 'exercice10 9-5', array(
                                                'label'      => 'exercice 9 response 5 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_9-5',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );                            
                            
           // Add a Course answer element
        $exercice10_subform9->addElement('ComboBox', 'course_answer_9', array(
                                                'label'      => 'Answer :',
                                                'required'   => true,
                                                'value'        => '1',
                                                'autocomplete' => true,
                                                'multiOptions' => array('1'    => '1',
                                                                        '2'    => '$translate->_("2")',
                                                                        '3'    => '$translate->_("3")',
                                                                        '4'    => '$translate->_("4")',
                                                                        '5'    => '$translate->_("5")',),
                                                'ErrorMessages' => array('required'=>'Element requis'),
                                                'promptMessage'    => 'Enter answer',
                                                'id'            => 'course_answer_9',
                                                'class'            => 'static',
                                                'invalidMessage' => 'Invalid type',
                                                            )
                            );                            
        //First question :
        // Add a exercice10 name element
        $exercice10_subform10->addElement('validationTextBox', 'exercice10 10-1', array(
                                                'label'      => 'exercice 10 response 1 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_10-1',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform10->addElement('validationTextBox', 'exercice10 10-2', array(
                                                'label'      => 'exercice 10 response 2 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_10-2',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );
                            
        $exercice10_subform10->addElement('validationTextBox', 'exercice10 10-3', array(
                                                'label'      => 'exercice 10 response 3 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_10-3',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform10->addElement('validationTextBox', 'exercice10 10-4', array(
                                                'label'      => 'exercice 10 response 4 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_10-4',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );

        $exercice10_subform10->addElement('validationTextBox', 'exercice10 10-5', array(
                                                'label'      => 'exercice 10 response 5 :',
                                                'required'   => true,
                                                'filters'    => array('StripTags',
                                                                    'StringTrim'),
                                                'regExp'         => '^[\sa-zA-Z0-9_-]{2,1000}$',
                                                'ErrorMessages' => array('required'=> '$translate->_("Ce champs est vide : vous devez le compléter")'),
                                                'invalidMessage' => 'Invalid exercice10 name must be between 1 and 1000 alphanumeric characters',
                                                'promptMessage'    => 'Enter your exercice10 answer',
                                                'id'            => 'exercice10_10-5',
                                                'class'            => 'static'
                                                    ),
                                                array()
                            );                            
                            
           // Add a Course answer element
        $exercice10_subform10->addElement('ComboBox', 'course_answer_10', array(
                                                'label'      => 'Answer :',
                                                'required'   => true,
                                                'value'        => '1',
                                                'autocomplete' => true,
                                                'multiOptions' => array('1'    => '1',
                                                                        '2'    => '$translate->_("2")',
                                                                        '3'    => '$translate->_("3")',
                                                                        '4'    => '$translate->_("4")',
                                                                        '5'    => '$translate->_("5")',),
                                                'ErrorMessages' => array('required'=>'Element requis'),
                                                'promptMessage'    => 'Enter answer',
                                                'id'            => 'course_answer_10',
                                                'class'            => 'static',
                                                'invalidMessage' => 'Invalid type',
                                                            )
                            );                            

/*#######################################*/                       
/*###### Here comes the decorators ######*/
/*#######################################*/
         
                              
        /*Set form Decorators*/
        $this->setDecorators(array(
                                    array('FormElements'),
                                     array('HtmlTag', array('tag' => 'div','class' => 'static', 'class' => 'thundra')),
                                      array('DijitForm')
                                      )
                            );                                            
                                                                    
        /*Set form commons elements Decorators*/                                                
        $this->setElementDecorators(array(
                                        array('ViewHelper', 'Description',
        'Errors',),
                                         ),
                                     null,
                                     null
                                 );
                            
        /*Set subform Decorators*/     
        $this->setSubFormDecorators(array(
                                            array('FormElements')
                                      )
                                   );

                                   
        /*Add Specific Subgroup Decorators*/
        $this->getSubForm('exercice10_subform0')->addDecorators(array(
                                                                        array('Fieldset', array('class' => 'static',
                                                                                                'legend' => 'exercice :')
                                                                         )
                                                                    ));        
        $this->getSubForm('exercice10_subform1')->addDecorators(array(
                                                                        array('Fieldset', array('class' => 'static',
                                                                                                'legend' => 'exercice :')
                                                                         )
                                                                    ));    
        $this->getSubForm('exercice10_subform2')->addDecorators(array(
                                                                        array('Fieldset', array('class' => 'static',
                                                                                                'legend' => 'exercice :')
                                                                         )
                                                                    ));    
        $this->getSubForm('exercice10_subform3')->addDecorators(array(
                                                                        array('Fieldset', array('class' => 'static',
                                                                                                'legend' => 'exercice :')
                                                                         )
                                                                    ));    
        $this->getSubForm('exercice10_subform4')->addDecorators(array(
                                                                        array('Fieldset', array('class' => 'static',
                                                                                                'legend' => 'exercice :')
                                                                         )
                                                                    ));
        $this->getSubForm('exercice10_subform5')->addDecorators(array(
                                                                        array('Fieldset', array('class' => 'static',
                                                                                                'legend' => 'exercice :')
                                                                         )
                                                                    ));    
        $this->getSubForm('exercice10_subform6')->addDecorators(array(
                                                                        array('Fieldset', array('class' => 'static',
                                                                                                'legend' => 'exercice :')
                                                                         )
                                                                    ));
        $this->getSubForm('exercice10_subform7')->addDecorators(array(
                                                                        array('Fieldset', array('class' => 'static',
                                                                                                'legend' => 'exercice :')
                                                                         )
                                                                    ));    
        $this->getSubForm('exercice10_subform8')->addDecorators(array(
                                                                        array('Fieldset', array('class' => 'static',
                                                                                                'legend' => 'exercice :')
                                                                         )
                                                                    ));    
        $this->getSubForm('exercice10_subform9')->addDecorators(array(
                                                                        array('Fieldset', array('class' => 'static',
                                                                                                'legend' => 'exercice :')
                                                                         )
                                                                    ));    
        $this->getSubForm('exercice10_subform10')->addDecorators(array(
                                                                        array('Fieldset', array('class' => 'static',
                                                                                                'legend' => 'exercice :')
                                                                         )
                                                                    ));    
    
    
    
    
    
    
    
    
    
    
        
    }
}
?>

Dernière modification par daverck (08-05-2014 18:16:02)

Hors ligne

 

#2 04-05-2014 17:11:36

daverck
Membre
Date d'inscription: 14-09-2009
Messages: 30

Re: [Résolu][Zend_Form][ formulaire qui ne vérifie pas la fonction isValid

et voilà le Zend_Debug::dump($_POST);

Code:

array(12) {
  ["exercice10_subform0"] => array(7) {
    ["exercice_name"] => string(4) "qsdf"
    ["exercice_about"] => string(4) "qsdf"
    ["exercice_update_type"] => string(8) "original"
    ["exercice_update_comment"] => string(4) "qsdf"
    ["exercice_agreement"] => string(1) "1"
    ["exercice_content"] => string(7) "content"
    ["exercice_category_id"] => string(1) "1"
  }
  ["exercice10_subform1"] => array(6) {
    ["exercice1011"] => string(4) "qsdf"
    ["exercice1012"] => string(4) "qsdf"
    ["exercice1013"] => string(4) "qsdf"
    ["exercice1014"] => string(4) "qsdf"
    ["exercice1015"] => string(4) "qsdf"
    ["course_answer_1"] => string(1) "1"
  }
  ["exercice10_subform2"] => array(6) {
    ["exercice1021"] => string(4) "sqdf"
    ["exercice1022"] => string(4) "qsdf"
    ["exercice1023"] => string(4) "qsdf"
    ["exercice1024"] => string(4) "sqdf"
    ["exercice1025"] => string(4) "sqdf"
    ["course_answer_2"] => string(1) "1"
  }
  ["exercice10_subform3"] => array(6) {
    ["exercice1031"] => string(4) "sqdf"
    ["exercice1032"] => string(4) "qsdf"
    ["exercice1033"] => string(4) "sqdf"
    ["exercice1034"] => string(4) "qsdf"
    ["exercice1035"] => string(4) "sqdf"
    ["course_answer_3"] => string(1) "1"
  }
  ["exercice10_subform4"] => array(6) {
    ["exercice1041"] => string(4) "qsdf"
    ["exercice1042"] => string(4) "qsdf"
    ["exercice1043"] => string(4) "sqdf"
    ["exercice1044"] => string(4) "sdqf"
    ["exercice1045"] => string(4) "qsfd"
    ["course_answer_4"] => string(1) "1"
  }
  ["exercice10_subform5"] => array(6) {
    ["exercice1051"] => string(3) "qsf"
    ["exercice1052"] => string(4) "qsdf"
    ["exercice1053"] => string(4) "sdfq"
    ["exercice1054"] => string(4) "sqdf"
    ["exercice1055"] => string(4) "sqdf"
    ["course_answer_5"] => string(1) "1"
  }
  ["exercice10_subform6"] => array(6) {
    ["exercice1061"] => string(4) "sqdf"
    ["exercice1062"] => string(4) "sqdf"
    ["exercice1063"] => string(3) "sqf"
    ["exercice1064"] => string(4) "sqdf"
    ["exercice1065"] => string(4) "qsdf"
    ["course_answer_6"] => string(1) "1"
  }
  ["exercice10_subform7"] => array(6) {
    ["exercice1071"] => string(4) "sdfq"
    ["exercice1072"] => string(4) "sdqf"
    ["exercice1073"] => string(4) "sqdf"
    ["exercice1074"] => string(4) "qsfd"
    ["exercice1075"] => string(4) "qsdf"
    ["course_answer_7"] => string(1) "1"
  }
  ["exercice10_subform8"] => array(6) {
    ["exercice1081"] => string(4) "sdfq"
    ["exercice1082"] => string(4) "qsfd"
    ["exercice1083"] => string(4) "qsdf"
    ["exercice1084"] => string(4) "sqdf"
    ["exercice1085"] => string(4) "sqdf"
    ["course_answer_8"] => string(1) "1"
  }
  ["exercice10_subform9"] => array(6) {
    ["exercice1091"] => string(4) "sdfq"
    ["exercice1092"] => string(4) "sdfq"
    ["exercice1093"] => string(4) "qsdf"
    ["exercice1094"] => string(4) "qsfd"
    ["exercice1095"] => string(4) "sqdf"
    ["course_answer_9"] => string(1) "1"
  }
  ["exercice10_subform10"] => array(6) {
    ["exercice10101"] => string(4) "qsdf"
    ["exercice10102"] => string(4) "sdqf"
    ["exercice10103"] => string(4) "sqdf"
    ["exercice10104"] => string(4) "sdfq"
    ["exercice10105"] => string(4) "qsdf"
    ["course_answer_10"] => string(1) "1"
  }
  ["exercice10_submit"] => string(4) "Save"
}

merci à ceux qui pourront me mettre sur la voie smile

Hors ligne

 

#3 08-05-2014 18:04:52

daverck
Membre
Date d'inscription: 14-09-2009
Messages: 30

Re: [Résolu][Zend_Form][ formulaire qui ne vérifie pas la fonction isValid

Voici ce que retourne getMessages :

Code:

array(10) {
  ["exercice10_subform1"] => array(5) {
    ["exercice10 1-1"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 1-2"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 1-3"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 1-4"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 1-5"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
  }
  ["exercice10_subform2"] => array(5) {
    ["exercice10 2-1"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 2-2"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 2-3"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 2-4"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 2-5"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
  }
  ["exercice10_subform3"] => array(5) {
    ["exercice10 3-1"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 3-2"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 3-3"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 3-4"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 3-5"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
  }
  ["exercice10_subform4"] => array(5) {
    ["exercice10 4-1"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 4-2"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 4-3"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 4-4"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 4-5"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
  }
  ["exercice10_subform5"] => array(5) {
    ["exercice10 5-1"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 5-2"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 5-3"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 5-4"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 5-5"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
  }
  ["exercice10_subform6"] => array(5) {
    ["exercice10 6-1"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 6-2"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 6-3"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 6-4"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 6-5"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
  }
  ["exercice10_subform7"] => array(5) {
    ["exercice10 7-1"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 7-2"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 7-3"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 7-4"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 7-5"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
  }
  ["exercice10_subform8"] => array(5) {
    ["exercice10 8-1"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 8-2"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 8-3"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 8-4"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 8-5"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
  }
  ["exercice10_subform9"] => array(5) {
    ["exercice10 9-1"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 9-2"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 9-3"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 9-4"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 9-5"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
  }
  ["exercice10_subform10"] => array(5) {
    ["exercice10 10-1"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 10-2"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 10-3"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 10-4"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
    ["exercice10 10-5"] => array(1) {
      [0] => string(62) "$translate->_("Ce champs est vide : vous devez le compléter")"
    }
  }
}

Hors ligne

 

#4 08-05-2014 18:14:48

daverck
Membre
Date d'inscription: 14-09-2009
Messages: 30

Re: [Résolu][Zend_Form][ formulaire qui ne vérifie pas la fonction isValid

apparement le regex et le required ne se cotoient pas.

Hors ligne

 

Pied de page des forums

Propulsé par PunBB
© Copyright 2002–2005 Rickard Andersson
Traduction par punbb.fr

Graphisme réalisé par l'agence Rodolphe Eveilleau
Développement par Kitpages