Update subscribe

This commit is contained in:
Moe Poi ~ 2021-11-21 12:30:49 +07:00
parent fc3d5ac31a
commit fd41aaae58
2 changed files with 16 additions and 11 deletions

View file

@ -185,4 +185,11 @@ jQuery(document).ready(function ($) {
}
}
}
})
})
function subscribe() {
let request = new XMLHttpRequest();
let email = document.getElementById("newsletter_email").value;
request.open('GET', `api/subscribe?email=${email}`, false);
request.send(null);
}

View file

@ -561,16 +561,14 @@
</div>
</div>
<div class="col-lg-6">
<form action="post">
<div class="newsletter_form d-flex flex-md-row fex-column flex-xs-column
align-items-center justify-content-lg-end justify-content-center">
<input id="newsletter_email" type="email" placeholder="Input Your Email" required="required"
data-error="valid email is required">
<button id="newsletter_submit" type="submit" class="newsletter_submit_btn trans_300"
value="submit">Subscribe
</button>
</div>
</form>
<div class="newsletter_form d-flex flex-md-row fex-column flex-xs-column
align-items-center justify-content-lg-end justify-content-center">
<input id="newsletter_email" type="email" placeholder="Input Your Email" required="required"
data-error="valid email is required">
<button id="newsletter_submit" class="newsletter_submit_btn trans_300"
onclick="subscribe()" value="submit">Subscribe
</button>
</div>
</div>
</div>
</div>