As Gerry pointed out, you're preventing the form from being submitted whether or not there are any validation errors.
You need to change your code so that it only prevents the form from being submitted if there are validation errors. If there are no validation errors, it should allow the form to be submitted.
For example:
$(function() {
$('#first_form').submit(function(e) {
$("#first_form .error").remove();
... VALIDATION CODE HERE ...
if ($("#first_form .error").length) {
e.preventDefault();
}
});
});
Personally, I'd recommend switching to the jQuery Validation plugin instead:
jQuery Validation Plugin | Form validation with jQuery[
^]
Or use the built-in form validation attributes:
Form data validation - Learn web development | MDN[
^]