title: issues with credit card validation
body: <p>I am using credit card validation in my cartridge project to validate the card type and card number.Everything is working fine, but whenever I got the validation error in alert box and when I click OK it doesn't stop on that page but refer me to the next page,Thus I am getting an error or not my order is got placed. </p>
  
  <p>Here is my code.</p>
  
  <pre><code>&lt;input type="submit" class="btn btn-large btn-primary" onClick="cardchk();" value="{% trans "Next" %}"&gt;
  
      function cardchk()
      {
  
          var card_typ=$("input[name='card_type']:checked")[0].value;
          //alert(card_typ);
  
          if(card_typ=='Visa')
          {
              var  cardname = 'Visa';
          }
          else
          {
              var  cardname = 'MasterCard';
          }
          //alert(cardname);
          var cardnumber = document.getElementById('id_card_number').value;
          if(!checkCreditCard (cardnumber, cardname)){
              alert(ccErrors[ccErrorNo]);
              return false;
          }
  
      }
  </code></pre>
  
  <p>However I have returned false in my function but on getting error it refer me to the confirmation page but I want as normally validation do to stop processing the request whenever I got the error</p>
  
  <p>Thanks ! </p>