title: Update hidden field on submit
body: <p>I am using Stripe.js to create a token. I want to pass this token to the next page via a hidden field. Unfortunately, the hidden field doesn't update onchange as it should do.</p>
  
  <pre><code>var stripe = Stripe('pk_test_pTMOD3umdVw9RkEYB35tz28X');
  var elements = stripe.elements();
  
  var card = elements.create('card', {hidePostalCode: true});
  card.mount('#card-element');
  
  var inputs = document.querySelectorAll('input.field');
  Array.prototype.forEach.call(inputs, function(input) {
    input.addEventListener('focus', function() {
      input.classList.add('is-focused');
    });
    input.addEventListener('blur', function() {
      input.classList.remove('is-focused');
    });
    input.addEventListener('keyup', function() {
      if (input.value.length === 0) {
        input.classList.add('is-empty');
      } else {
        input.classList.remove('is-empty');
      }
    });
  });
  
  function setOutcome(result) {
    var errorElement = document.querySelector('.error');
    errorElement.classList.remove('visible');
  
    if (result.token) {
      document.getElementById("cc_token").value = result.token.id;
    } else if (result.error) {
      errorElement.textContent = result.error.message;
      errorElement.classList.add('visible');
    }
  }
  
  card.on('change', function(event) {
    setOutcome(event);
  });
  
  document.querySelector('#registrationForm').addEventListener('submit', function(e) {
    stripe.createToken(card).then(setOutcome);
  });
  </code></pre>
  
  <p><code>setOutcome</code> works when I call it, but it does't get called properly onchange.</p>