jQuery-submit forms after preventDefault
There is such a code, I check the existence of the entered value in the database via ajax:
$(".cu_process").on('submit', function(e) {
e.preventDefault();
$.post('/checkurl?type=' + $(this).attr('type'), { url: $(".url").val() }, function(data) {
if (data == "true") alert("Ссылка уже существует");
else {
$(this).unbind('submit').submit();
}
});
});
If everything is fine, else is executed, but the line $(this).unbind('submit').submit();
does not work, is there any way to continue sending the form?
0
Author: Daniel Protopopov, 2020-09-17