title: Accepting Bank Account using Stripe.js
body: <p>I'm trying to create a form that accepts a users bank account details using Stripe.js and HTML. The problem is, every time i try to submit the details, I get an error regardless of whether or not it is right. The input form is below. Any ideas?</p>
  
  <pre><code>&lt;head&gt;
    &lt;meta http-equiv="Content-type" content="text/html; charset=utf-8" /&gt;
  
    &lt;!-- The required Stripe lib --&gt;
    &lt;script type="text/javascript" src="https://js.stripe.com/v2/"&gt;&lt;/script&gt;
  
    &lt;!-- jQuery is used only for this example; it isn't required to use Stripe --&gt;
    &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  
    &lt;script type="text/javascript"&gt;
      // This identifies your website in the createToken call below
      //blanking my test key out just for stackoverflow 
      Stripe.setPublishableKey('pk_test_XXXXXXXXXXXXX');
      var stripeResponseHandler = function(status, response) {
          var $form = $('#inst-form');
          if (response.error)
          {
            alert("Error");
            // Not sure how to get these errors.
            $form.find('button').prop('disabled', false);
          }
          else
          {
            var token = response.id;
            $form.append($('&lt;input type="hidden" name="stripeToken" /&gt;').val(token));
            $form.get(0).submit();
          }
        };
  
        // Now the handler is done, lets use it when the form is submitted.
        // On form submission execute:
        jQuery(function($) {
          $('#inst-form').submit(function(event) {
            // Get the form object.
            var $form = $(this);
            // Disable the submit button to prevent repeated clicks
            $form.find('button').prop('disabled', true);
            // Create a token with Stripe
            Stripe.bankAccount.createToken({
              country: $('.country').val(),
              routingNumber: $('.routingNumber').val(),
              accountNumber: $('.accountNumber').val(),
            }, stripeResponseHandler);
            // Prevent the form from submitting with the default action
            return false;
          });
        });
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;h1&gt;Give us your bank info&lt;/h1&gt;
  
  
  &lt;form method="POST" id="inst-form"&gt;    
  
      &lt;div class="form-row"&gt;
        &lt;label&gt;
          &lt;span&gt;Bank Location&lt;/span&gt;
              &lt;select data-stripe="country"&gt;
                  &lt;option value="US"&gt;United States&lt;/option&gt;
              &lt;/select&gt;
        &lt;/label&gt;
      &lt;/div&gt;
  
      &lt;div class="form-row"&gt;
        &lt;label&gt;
          &lt;span&gt;Routing Number&lt;/span&gt;
              &lt;input type="text" size="9" data-stripe="routingNumber"/&gt;
        &lt;/label&gt;
      &lt;/div&gt;
  
      &lt;div class="form-row"&gt;
        &lt;label&gt;
          &lt;span&gt;Account Number&lt;/span&gt;
              &lt;input type="text" size="17" data-stripe="accountNumber"/&gt;
        &lt;/label&gt;
      &lt;/div&gt;
  
  
      &lt;button type="submit"&gt;Make Recipient!&lt;/button&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>