forked from LiveCarta/LiveCartaWP
LAW-5279
This commit is contained in:
24
htdocs/wp-content/plugins/subscribe-to-lc/js/subscribe.js
Normal file
24
htdocs/wp-content/plugins/subscribe-to-lc/js/subscribe.js
Normal file
@@ -0,0 +1,24 @@
|
||||
$(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;
|
||||
})
|
||||
});
|
||||
Reference in New Issue
Block a user