title: Validation form in Symfony 1.4
body: <p>I create a search form in my project but the validation seems not to be working :</p>
  
  <p>Filtersearchform : </p>
  
  <pre><code>class FilterSearchForm extends sfForm
   {
    public function configure()
      {
  
  $def_volume = array(-1=&gt;"Please select a volume");
  $def_issue = array(-1=&gt;"Please select issue");
  
  $volumes = array_merge($def_volume,IssuePeer::getAllVolumesForListChoices());
  $issues = array_merge($def_issue,IssuePeer::getAllIssuesForListChoices());
  
  
  //******************************** WIDGET **************************************//
     $this-&gt;setWidgets(array(
    'keyword'    =&gt; new sfWidgetFormInput(),
    'volume' =&gt; new sfWidgetFormSelect(array('choices' =&gt; $volumes)),
    'issue' =&gt; new sfWidgetFormSelect(array('choices' =&gt; $issues)),
  ));
  
             //*****************************************  VALIDATORS           
            **********************************//
     $this-&gt;setValidators(array(
    'keyword'    =&gt; new sfValidatorString(array('required' =&gt; true)),
    'volume' =&gt; new sfValidatorChoice(array('choices' =&gt; array_keys(IssuePeer::getAllVolumesForListChoices()))),
    'issue' =&gt; new sfValidatorChoice(array('choices' =&gt; array_keys(IssuePeer::getAllIssuesForListChoices()))),
  ));
  
  
  $this-&gt;widgetSchema-&gt;setNameFormat('filterSearch[%s]');
  $this-&gt;errorSchema = new sfValidatorErrorSchema($this-&gt;validatorSchema);
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>in search action : </p>
  
  <pre><code>$this-&gt;form = new FilterSearchForm();
  </code></pre>
  
  <p>in search template : </p>
  
  <pre><code>            &lt;form id="form_content" method="post" action="&lt;?php echo url_for('@ResultSearch')  ?&gt;"&gt;
                  &lt;?php echo $form-&gt;renderHiddenFields(); ?&gt;
  
              &lt;?php if($form-&gt;hasGlobalErrors()): ?&gt;
              &lt;ul class="error_list"&gt;
                  &lt;?php foreach($form-&gt;getGlobalErrors() as $name =&gt; $error): ?&gt;
                  &lt;li&gt;&lt;?php echo $error; ?&gt;&lt;/li&gt;
                  &lt;?php endforeach; ?&gt;
              &lt;/ul&gt;
             &lt;?php endif; ?&gt;
                  &lt;div class="search_word" &gt;
  
                          &lt;?php echo $form['keyword']-&gt;render();?&gt;
                  &lt;?php echo $form['keyword']-&gt;renderError() ?&gt;
                  &lt;/div&gt;
                      &lt;div class="select-wrapper" data-icon="&amp;#710;"&gt;
  
                     &lt;?php echo $form['volume']-&gt;render();?&gt;
                     &lt;?php echo $form['volume']-&gt;renderError() ?&gt;
                      &lt;/div&gt;
                      &lt;div class="select-wrapper" data-icon="&amp;#710;" &gt;
                                      &lt;?php echo $form['issue']-&gt;render();?&gt;
                  &lt;?php echo $form['issue']-&gt;renderError() ?&gt;
  
                      &lt;/div&gt;
                  &lt;div class="search_button"&gt;
                  &lt;button class="msg_submit_btn" id="fpost" type="submit"&gt;&lt;/button&gt;
                  &lt;/div&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>in Result search action :</p>
  
  <pre><code> if ($request-&gt;isMethod('post'))
  {
    $this-&gt;form = new FilterSearchForm();
    $this-&gt;form-&gt;bind($request-&gt;getParameter('filterSearch'));
    if ($this-&gt;form-&gt;isValid())
    {
  
        $values = $this-&gt;form-&gt;getValues();
  
     $keyword = trim($values['keyword']);
     $volume = trim($values['volume']);
     $issue = trim($values['issue']);
  
     $search= new Issue();
  
    $object = $search-&gt;searchFilter($issue, $volume, $keyword);
  
        $this-&gt;results= $object;   
  
    }
  }   
  </code></pre>
  
  <p>and Finally in ResultSearch Template : </p>
  
  <pre><code>&lt;?php foreach ($results as $result): ?&gt;
  .....
  </code></pre>
  
  <p>So for example in my search tempalte when I keep the keyword field empty in form and i click submit, that redirect me to Result search without showing the "error validation" ==> "keyword required".</p>
  
  <p>hen I put var_dump i remark that the code also stop here <code>if ($this-&gt;form-&gt;isValid())</code> in Resultsearch action.</p>
  
  <p>Any Idea?</p>
  
  <p>Edit : </p>
  
  <p>I remark that when I use just one page in the code above "search template",that mean the post method redirect in the same page <code>&lt;form id="form_content" method="post" action=""&gt;</code>, so the validation of the form works fine,but not that what I wish,I hope to redirect after submitting and pass the data of search to another page in the code above is "Resultsearch" template.</p>