title: check field and redirection on a multistep webform - Drupal
body: <p>I have set up a multistep webform on a Drupal website and I am trying to check a field and stay on the first page of the webform if the field doesn't meet the conditions. On the first step of the webform, a user enters a company name in a textfield (comp_name). When the user pushes next, I want to check if the company name entered is a title of a node .
  So far I have:</p>
  
  <pre><code>function check_for_company_form_alter(&amp;$form, $form_state, $form_id)
  {
  if ($form_id == "webform_client_form_2")
  {   
      if($form_state['post']['details']['page_num'] == 1){
          $comp_name = $form_state['post']['submitted']['comp_name'];
          $query = "SELECT nid FROM node WHERE title='".$comp_name."'";
          $nidComp= db_result(db_query($query));
          if($nidComp&gt;0){
          echo 'we found node id'.$nidComp;
          }
       else{
            //redirection to page 1 of the multistep form
       }
      }
  
  
  }
  } 
  </code></pre>
  
  <p>The code works well but I cannot find out how to redirect to page 1. </p>