function getFormContents(form) {
  var data = $(form).serializeArray(), attributes = {};

  for(var key in data) {
    if(data.hasOwnProperty(key)) {