Design a site like this with
Get started

Validate form to check if any text box is empty on submit

Solution Call this function on submit or save button to validate the form. var checkEmpty = function () { var formInvalid = false; $('#MyForm').each(function () { if ($(this).val() === '') { formInvalid = true; } }); if (formInvalid) { alert('One or more fields are empty. Please fill up all fields'); return false; } else return... Continue Reading →

Blog at

Up ↑