Skip to content

Instantly share code, notes, and snippets.

@asifsaho
Created January 24, 2017 05:11
Show Gist options
  • Save asifsaho/7b53d4d102725b2a6f36797dacf12808 to your computer and use it in GitHub Desktop.
Save asifsaho/7b53d4d102725b2a6f36797dacf12808 to your computer and use it in GitHub Desktop.
$('form.claim-details input, form select, form textarea').each(function () {
this.backup = this.value;
});
$('form.claim-details').on('change keyup', 'input,select,textarea', function () {
if (this.value !== this.backup) {
this.backup = this.value;
this.form.isDirty = true;
//$(this).addClass('field-dirty');
//$(this.form).addClass('form-dirty');
//console.log('form is dirty');
var msisdn = $('#id_object_id').text().trim(),
accountNo = $('#id_account_number').val();
if (msisdn === accountNo) $('#save-changes-btn').removeAttr('disabled');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment