title: Codeigniter form_validation help
body: <p>Hi there I am having a problem with my form validation, basically the problem is that I am getting a repeated view loaded if the validation fails, please see my code snippet, </p>
  
  <pre><code>else {
              //the user is a new customer so we need to show them 
              //the card details form
              $this-&gt;addViewData('returningCustomer', false);
              $this-&gt;load-&gt;library('form_validation');
              if($this-&gt;input-&gt;post('carddetails') == 'Submit') {
                  $this-&gt;form_validation-&gt;set_rules('inpcardtype', 'Card type', 'cardTypeCheck'); //custom callback
                  $this-&gt;form_validation-&gt;set_rules('inpcardnumber', 'Card number', 'required|trim|exact_length[16]');
                  $this-&gt;form_validation-&gt;set_rules('startmonth', 'Start month', 'trim|required');
                  $this-&gt;form_validation-&gt;set_rules('startyear', 'Start year', 'trim|required');
                  $this-&gt;form_validation-&gt;set_rules('endmonth', 'End month', 'trim|required');
                  $this-&gt;form_validation-&gt;set_rules('endyear', 'End year', 'trim|required');
                  $this-&gt;form_validation-&gt;set_rules('inpissuenumber', 'Issue number', 'trim|integer');
                  $this-&gt;form_validation-&gt;set_rules('inpccv', 'CCV Code', 'required|trim|exact_lenght[3]');
                  if($this-&gt;form_validation-&gt;run() == FALSE) {
                      $this-&gt;renderTemplate('cv/search/pf_shortlist.php', $this-&gt;viewData);
                  } else {
                      // validation is passed we need to safe the user details
                      // it is probable that we will need to hash the users card details
                      //@TODO: HASH USER CARD DETAILS LEAVE ONLY THE FINAL DIGITS
                      $this-&gt;load-&gt;model('checkout_model');
                  }
              }
              $this-&gt;renderTemplate('cv/search/pf_shortlist.php', $this-&gt;viewData);
  </code></pre>
  
  <p>basically if a condtion fails futher up the script a view is loaded with a form, the form is submitted and if validation fails the user is passed back to the form but is show the errors, however the original view is also present. Can I stop it doing this?</p>