Я пытаюсь открыть всплывающую форму после успешной отправки формы, но она не работает. Ниже приведен код, который я использую
Javascript / ajax: -
$(document).ready(function() {
$('form[id="emailForm"]').validate({
rules: {
cta_newsletter_email: {
required: true,
email: true,
}
},
messages: {
//cta_newsletter_email: 'Enter a valid email'
},
submitHandler: function(form) {
// alert('here');
// form.submit();
$.ajax({
//alert('here');
url: form.action,
url: "email_process.php",
type: "post",
data: $(form).serialize(),
success: function(response) {
// alert(response);
if(response == 'success'){
// $('#better-popup').modal();
$('#better-popup').modal('show');
}
else{
alert("fail");
}
}
});
}
});
});