Skip to content

Instantly share code, notes, and snippets.

Created December 7, 2012 02:02
Show Gist options
  • Save anonymous/4230145 to your computer and use it in GitHub Desktop.
Save anonymous/4230145 to your computer and use it in GitHub Desktop.
Form handler that doesn't work in Firefox
formEvent: function () {
console.log(event); // "Not defined!" -- Firefox
eventType = event.target.type;
switch (eventType) {
case "checkbox":
classArray = event.target.classList;
key = classArray[0];
value = classArray[1];
checkedStatus = event.target.checked;
this.toggleShown(key, value, checkedStatus, "checkbox");
break;
case "radio":
this.sortThingsByColumn(event.target.className);
return this;
break;
case "select-one":
value = event.target.value;
key = event.target.classList[0];
this.toggleSelect(key, value);
break;
default:
break;
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment