Skip to content

Instantly share code, notes, and snippets.

@zachshallbetter
Created July 2, 2013 15:24
Show Gist options
  • Save zachshallbetter/5910250 to your computer and use it in GitHub Desktop.
Save zachshallbetter/5910250 to your computer and use it in GitHub Desktop.
Form Input Mixin
var FormInputMixin = {
getValue: function() {
return this.$el.val();
},
setValue: function(val) {
return this.$el.val(val);
}
}
var FormInputs = ['Textbox', 'Select', 'Checkbox'];
$.each(FormInputs, function(input) {
$.extend(input.prototype, FormInputMixin);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment