Так форма должна отправляться, если удалась валидация!
<form id="form_name" action="save_user.php">
<input id="first_name" name="first_name" required>
<input type="submit" id="btn_name">
<output id="message"></output>
</form>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(function () {
$('#form_name').submit(function(e) {
e.preventDefault();
var first_name = $('#first_name').val();
$(".error").remove();
if (first_name.length < 1) {
$('#first_name').after('<span class="error">This field is required</span>');
} else {
sendForm('form_name', 'form_pass');
}
});
});
function sendForm(form_name, form_pass) {
var form = $("#" + form_name);
$.ajax({
url: form.attr("action"),
type: "POST",
dataType: "html",
data: form.serialize(),
success: function (response) {
$('#message').html('OK');
var result = $.parseJSON(response);
},
error: function (response) {
$('#message').html('Error message');
}
});
}
</script>