Skip to content

Instantly share code, notes, and snippets.

@morshedalam
Last active December 30, 2015 08:29
Show Gist options
  • Save morshedalam/1cb0903abb9e3d1ca0ff to your computer and use it in GitHub Desktop.
Save morshedalam/1cb0903abb9e3d1ca0ff to your computer and use it in GitHub Desktop.
Remove form field with empty value on submit
var disableEmptyFormField = function (ele){
ele.find('input,select').each(function () {
if ($(this).val() == '') {
$(this).attr("disabled", "disabled");
}
});
ele.find('button').attr("disabled", "disabled");
$('.filter-manufacturers input[type="checkbox"]').removeAttr('checked');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment