Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('form[name= "login"]').submit(function(event) {
- event.preventDefault();
- const form = $(this);
- const action = form.attr("action");
- const email = form.find('input[name = "email"]').val();
- const password = form.find('input[name = "password_check"]').val();
- $.post(
- action,
- { email: email, password: password },
- function(response) {
- console.log(response);
- if (response.message) {
- ajaxMessage(response.message, 3);
- }
- if (response.redirect) {
- window.location.href = response.redirect;
- }
- },
- "json"
- );
- });
Add Comment
Please, Sign In to add comment