Thursday, January 16, 2014

Check Form IS Dirty (If the user is changed any values from the form)

function isFormValuesChanged() { var isDirty = false; try{ $(':input').each(function () { if($(this).data('initialValue') != 'undefined' && $(this).val() != 'undefined' && $(this).data('initialValue') != $(this).val()){ isDirty = true; } }); }catch(e){ } return isDirty; }

No comments:

Post a Comment