The solution should be pretty straightforward. I\'m trying to prevent the form from submitting properly when no value is found within the input boxes. Here\'s my JSFiddle: h
Your check occurs on page load. You need to check the field when the form is submitted.
$('#form').submit(function(e) {
if ($.trim($("#email, #user_name").val()) === "") {
e.preventDefault();
alert('you did not fill out one of the fields');
}
});