forked from LiveCarta/LiveCartaWP
25 lines
933 B
JavaScript
25 lines
933 B
JavaScript
$(document).ready(function () {
|
|
$(".lc-subscrive-form").on("submit", function () {
|
|
var form = $(this)
|
|
var data = {email: form.find("#subscribe-email").val(), formId: form.find("#subscribe-from-id").val()}
|
|
$.ajax({
|
|
url: form.attr('action'),
|
|
type: 'POST',
|
|
data: JSON.stringify(data),
|
|
contentType: 'application/json',
|
|
dataType: 'json',
|
|
success: function (data) {
|
|
if (data.success) {
|
|
msg = "<b>Almost finished...</b><br/><br/>We need to confirm your email address.<br/><br/>To complete the subscription process, please click the link in the email we just sent you."
|
|
customAlert(msg);
|
|
}
|
|
form[0].reset()
|
|
},
|
|
error: function (jqXHR) {
|
|
console.log(jqXHR)
|
|
}
|
|
});
|
|
return false;
|
|
})
|
|
});
|