|
|
@ -213,6 +213,9 @@ |
|
|
|
<div class="custom-search"> |
|
|
|
<div class="custom-search"> |
|
|
|
<input type="text" name = "email" id = "subscribe_email" class="custom-search-input" placeholder="Email address" onkeyup="subscribeValidation()"> |
|
|
|
<input type="text" name = "email" id = "subscribe_email" class="custom-search-input" placeholder="Email address" onkeyup="subscribeValidation()"> |
|
|
|
<button class="custom-search-botton" onclick="subscribe()" type="submit">Subscribe</button> |
|
|
|
<button class="custom-search-botton" onclick="subscribe()" type="submit">Subscribe</button> |
|
|
|
|
|
|
|
<button class="buttonload custom-search-botton" id="buttonload" disabled> |
|
|
|
|
|
|
|
<i class="fa fa-spinner fa-spin"></i> Loading |
|
|
|
|
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<span class="success-message" id="success-message"></span> |
|
|
|
<span class="success-message" id="success-message"></span> |
|
|
|
<span class="success-message" id="error-message"></span> |
|
|
|
<span class="success-message" id="error-message"></span> |
|
|
@ -289,7 +292,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
var email = document.getElementById('subscribe_email'); |
|
|
|
var email = document.getElementById('subscribe_email'); |
|
|
|
var successMessage = document.getElementById('success-message'); |
|
|
|
var successMessage = document.getElementById('success-message'); |
|
|
|
var errorMessage = document.getElementById('error-message') |
|
|
|
var errorMessage = document.getElementById('error-message'); |
|
|
|
|
|
|
|
var loaderBtn = document.getElementById('buttonload'); |
|
|
|
|
|
|
|
|
|
|
|
function subscribeValidation(){ |
|
|
|
function subscribeValidation(){ |
|
|
|
if(email.value.length == 0){ |
|
|
|
if(email.value.length == 0){ |
|
|
@ -306,6 +310,7 @@ |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
|
|
|
|
loaderBtn.classList.add('displayBtn') |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: "/subscribe", |
|
|
|
url: "/subscribe", |
|
|
|
type:"POST", |
|
|
|
type:"POST", |
|
|
@ -314,11 +319,9 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
success:function(response){ |
|
|
|
success:function(response){ |
|
|
|
if (response) { |
|
|
|
if (response) { |
|
|
|
$('#success-message').fadeOut(5000).text(response.success); |
|
|
|
$('#success-message').fadeOut(5000).text(response.success); |
|
|
|
email.value = ''; |
|
|
|
email.value = ''; |
|
|
|
console.log(response) |
|
|
|
loaderBtn.classList.remove('displayBtn'); |
|
|
|
// alert(response.success); |
|
|
|
|
|
|
|
// $("#contactForm")[0].reset(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function(response) { |
|
|
|
error: function(response) { |
|
|
|