Skip to content

Instantly share code, notes, and snippets.

@fractefactos
Created March 7, 2016 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fractefactos/185cf7f6fa06be2345c8 to your computer and use it in GitHub Desktop.
Save fractefactos/185cf7f6fa06be2345c8 to your computer and use it in GitHub Desktop.
$.fn.extend({
trackChanges:
function() {
$(':input', this).change(function() {
$(this.form).data('changed', true);
});
$(':textarea', this).change(function() {
$(this.form).data('changed', true);
});
$(':select', this).change(function() {
$(this.form).data('changed', true);
});
}
,
isChanged:
function() {
return this.data('changed');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment