Skip to content

Instantly share code, notes, and snippets.

@there4
Forked from anonymous/Catching clicks
Created December 7, 2012 02:29
Show Gist options
  • Save there4/4230265 to your computer and use it in GitHub Desktop.
Save there4/4230265 to your computer and use it in GitHub Desktop.
Form handler that doesn't work in Firefox
formEvent: function (event) {
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