My ajax code below will stop the form pprocess if an input value is empty, then showing an popup alert. The problem is, the process will continue after the alert popup closed. How can i stop the process until the input value is not empty?
$("#spdf-form").on('submit', function () {
var title = $('#spdf-form input[name="title"]').val();
var url = $('#spdf-form input[name="pdf"]').val();
if (title == "" || url == "") {
alert('Error; title or url is missing.');
return false;
}
});