title: Adding Jquery Datepicker in a Zend form
body: <p>Im new to Zend framework, i would like to know how to add a date picker jquery widget to a zend_form I googled extensively but could not find anything precise</p>
  
  <p>Kindly help me out. Thanks in advance!</p>
  
  <p><strong>Following is my Zend_form code</strong></p>
  
  <p><strong>Form code</strong></p>
  
  <pre><code>&lt;?php
  class Application_Form_Matriregistrationform extends Zend_Form
  {
      public $elementDecorators = array(
          'ViewHelper',
          'Errors',
          array(array('data' =&gt; 'HtmlTag'), array('tag' =&gt; 'td', 'class' =&gt; 'element')),
          array('Label', array('tag' =&gt; 'td')),
          array(array('row' =&gt; 'HtmlTag'), array('tag' =&gt; 'tr')),
      );
  
      public $buttonDecorators = array(
          'ViewHelper',
          array(array('data' =&gt; 'HtmlTag'), array('tag' =&gt; 'td', 'class' =&gt; 'element')),
          array(array('label' =&gt; 'HtmlTag'), array('tag' =&gt; 'td', 'placement' =&gt; 'prepend')),
          array(array('row' =&gt; 'HtmlTag'), array('tag' =&gt; 'tr')),
      );
  
  
      public function init()
      {
  
      $this-&gt;setAction('/matri/public/matri/matri')
          -&gt;setMethod('post');
  
  
          $id = $this-&gt;addElement('hidden', 'id', array(
            'decorators' =&gt; $this-&gt;elementDecorators,
  
          ));
  
  
      $email = new Zend_Form_Element_Text('username');
      $email-&gt;setLabel('Username')
            -&gt;addFilter('StringToLower')
                -&gt;setRequired(true)
                -&gt;addValidator('NotEmpty', true)
                -&gt;addValidator('EmailAddress')
            -&gt;setDecorators($this-&gt;elementDecorators);
      $this-&gt;addElement($email);
  
  
  
      $password = new Zend_Form_Element_Password('password');
      $password-&gt;setLabel('Password:')
          -&gt;setRequired(true)
          -&gt;setDecorators($this-&gt;elementDecorators);
      $this-&gt;addElement($password);
  
  
  
      $confpassword = new Zend_Form_Element_Password('confpassword');
      $confpassword-&gt;setLabel('Confirm Password:')
          -&gt;setRequired(true)
          -&gt;setDecorators($this-&gt;elementDecorators)
          -&gt;addValidator(new Zend_Validate_Identical($_POST['password']));
      $this-&gt;addElement($confpassword);
  
          $name = $this-&gt;addElement('text', 'firstname', array(
              'decorators' =&gt; $this-&gt;elementDecorators,
              'label'       =&gt; 'Name:',
          ));
      $this-&gt;addElement('datePicker','movie_release_date', array(
              'label' =&gt; 'Release Date:',
              'required'=&gt; false
              )
      );
  
  
  
  
      $gender2 = new Zend_Form_Element_Radio('gender');
  
          $gender2-&gt;setSeparator('')
          -&gt;setLabel('Gender:')
          -&gt;setRequired(true)
                  -&gt;addMultiOption('m', 'Male')
                  -&gt;addMultiOption('f', 'Female')
          -&gt;setDecorators($this-&gt;elementDecorators);
  
      $this-&gt;addElement($gender2);
  
          $DOB = $this-&gt;addElement('text', 'DOB', array(
              'decorators' =&gt; $this-&gt;elementDecorators,
              'label'       =&gt;'Date of Birth:',
          ));
  
          $religion = $this-&gt;addElement('text', 'religion', array(
              'decorators' =&gt; $this-&gt;elementDecorators,
              'label'       =&gt;'Religion:',
          ));
  
          $mothertongue = $this-&gt;addElement('text', 'mothertongue', array(
              'decorators' =&gt; $this-&gt;elementDecorators,
              'label'       =&gt;'Mother Tongue:',
          ));
  
          $country = $this-&gt;addElement('text', 'country', array(
              'decorators' =&gt; $this-&gt;elementDecorators,
              'label'       =&gt;'Country:',
          ));
  
          $maritalstatus = $this-&gt;addElement('text', 'maritalstatus', array(
              'decorators' =&gt; $this-&gt;elementDecorators,
              'label'       =&gt;'Marital Status:',
          ));
  
          $height = $this-&gt;addElement('text', 'height', array(
              'decorators' =&gt; $this-&gt;elementDecorators,
              'label'       =&gt;'Height:',
          ));
  
          $caste = $this-&gt;addElement('text', 'caste', array(
              'decorators' =&gt; $this-&gt;elementDecorators,
              'label'       =&gt;'Caste:',
          ));
  
  
  
  
          $smoke = $this-&gt;addElement('text', 'smoke', array(
              'decorators' =&gt; $this-&gt;elementDecorators,
              'label'       =&gt;'Smoke:',
          ));
      $smoke = new Zend_Form_Element_Radio('smoke');
      $smoke-&gt;setSeparator('')
          -&gt;setLabel('Smoke:')
          -&gt;setRequired(true)
                  -&gt;addMultiOption('yes', 'Yes')
                  -&gt;addMultiOption('no', 'No')
          -&gt;setDecorators($this-&gt;elementDecorators);
      $this-&gt;addElement($smoke);
  
  
      $drink = new Zend_Form_Element_Radio('drink');
      $drink-&gt;setSeparator('')
          -&gt;setLabel('Drink:')
          -&gt;setRequired(true)
                  -&gt;addMultiOption('yes', 'Yes')
                  -&gt;addMultiOption('no', 'No')
          -&gt;setDecorators($this-&gt;elementDecorators);
      $this-&gt;addElement($drink);
  
  
      $diet = new Zend_Form_Element_Radio('diet');
      $diet-&gt;setSeparator('')
          -&gt;setLabel('diet:')
          -&gt;setRequired(true)
                  -&gt;addMultiOption('yes', 'Yes')
                  -&gt;addMultiOption('no', 'No')
          -&gt;setDecorators($this-&gt;elementDecorators);
          $this-&gt;addElement($diet);
  
          $country = $this-&gt;addElement('text', 'country', array(
              'decorators' =&gt; $this-&gt;elementDecorators,
              'label'       =&gt;'Country:',
          ));
  
          $state = $this-&gt;addElement('text', 'state', array(
              'decorators' =&gt; $this-&gt;elementDecorators,
              'label'       =&gt;'State of Residence:',
          ));
  
          $city = $this-&gt;addElement('text', 'city', array(
              'decorators' =&gt; $this-&gt;elementDecorators,
              'label'       =&gt;'City of Residence:',
          ));
  
  
          $submit = new Zend_Form_Element_Submit('submit');
          $submit-&gt;setAttrib('id', 'submitbutton')
          -&gt;setDecorators($this-&gt;buttonDecorators);
      $this-&gt;addElement($submit);
  
  
          //$this-&gt;addElements(array($id, $username, $firstname, $lastname, $submit));
  
  
  
  
      }
  
      public function loadDefaultDecorators()
      {
          $this-&gt;setDecorators(array(
              'FormElements',
              array('HtmlTag', array('tag' =&gt; 'table')),
              'Form',
          ));
      }
  }
  </code></pre>
  
  <p><strong>Form action code</strong></p>
  
  <pre><code>public function matriAction()
      {   
  
  //      $this-&gt;_helper-&gt;layout-&gt;disableLayout();
          $form = new Application_Form_Matriregistrationform();
              $form-&gt;submit-&gt;setLabel('Profile Registration');
  
           if ($this-&gt;_request-&gt;isPost()) {
                  $formData = $this-&gt;_request-&gt;getPost();
                  if ($form-&gt;isValid($formData)) {
                      echo 'Form Successfully sumbitted!';
                      exit;
                  } else {
                      $form-&gt;populate($formData);
                  }
              }
  
  
  
              $this-&gt;view-&gt;form = $form;
  
  
  
  
      }
  </code></pre>