Problem with the submit

I am not receiving the data that i place in the input fields… since the event.preventDefault(); ain’t working for some reason any suggestions?

Are you getting an error in the Console ?

Same problem here. When I run :

var fh = new App.FormHandler('[data-coffee-order="form"]');

to get the seralized array, I get the console message (“setting submit handler from form”), but then it doesn’t prevent de default behaviour of “submit”. Submit button just reloads the page. I get no error message.

This is my formhandler.js

(function(window) {
  'use strict'
  var App = window.App || {};
  var $ = window.jQuery;

  function FormHandler(selector) {
    if (!selector) {
      throw new Error('No selector provided')
    this.$formElement = $(selector);
    if (this.$formElement.length === 0) {
      throw new Error('Could not find element with selector: ' + selector);

  FormHandler.prototype.addSubmitHandler = function() {
    console.log('Setting submit handler from form');
    this.$formElement.on('submit', function(event) {
      var data = $(this).seralizeArray();

  App.FormHandler = FormHandler;
  window.App = App;

and this is my index.html

<!DOCTYPE html>
<html lang="en" dir="ltr">

  <meta charset="utf-8">
  <link rel="stylesheet" href="">

<body class="container">
    <div class="panel panel-paneldefault">
      <div class="panel-body">
        <form data-coffee-order="form">
          <div class="form-group">
            <label for="coffeeOrder">Coffee Order</label>
            <input class="form-control" name="coffee" id="coffeeOrder" autofocus>
          <div class="form-group">
            <label for="emailInput">Email</label>
            <input class="form-control" name="emailAddress" id="emailInput" value="" placeholder="">
          <div class="radio">
              <input type="radio" name="size" value="short">
          <div class="radio">
              <input type="radio" name="size" value="tall" checked>
          <div class="radio">
              <input type="radio" name="size" value="grande">
          <div class="form-group">
            <label for="flavorShot">Flavor Shot</label>
            <select id="flavorShot" class="form-control" name="flavor">
              <option value="">None</option>
              <option value="caramel">Caramel</option>
              <option value="almond">Almond</option>
              <option value="mocha">Mocha</option>
          <div class="form-group">
            <label for="strengthLevel">Caffeine Rating</label>
            <input type="range" name="strength" id="strengthLevel" value="30">
          <button type="submit" class="btn btn-default">Submit</button>
          <button type="reset" class="btn btn-default">Reset</button>
  <script src="" charset="utf-8"></script>
  <script src="scripts/datastore.js" charset="utf-8"> </script>
  <script src="scripts/truck.js" charset="utf-8"></script>
  <script src="scripts/formhandler.js" charset="utf-8"></script>
    <script src="scripts/main.js" charset="utf-8"></script>



EDIT: I had two typos: “serializedArray” had one and I was writing the argument for the constructor wrong. All is good now

Same problem. Don’t really know how to solve it