There is a form
<form method="post" id="orderForm"> <input type=text> <input type=phone> <input type=email id=email> <input type=button id=submit_f> </form> $("#submit_f").click(function() { var email = $('#email').val(); $.ajax({ url: '/ajax/validation/email_validate.php', type: 'post', data: {email: email, type: 'checkEmail'}, success: function(data){ $('form#orderForm').trigger( 'reset' ); if(data == "ok"){ $('#submit_f').prop('disabled', true); $('form#orderForm').submit(); } else { swal("Пользователь с таким email уже существует", "", "error"); } } }) }); By clicking on the submit button, there is a check whether the entered email is in the database. And how to add a test for emptiness remaining input . Because I had to change type=submite to type=button required does not work.