by HEAVENLY UPDATES
VICE
04 Jul, 2021
Vice
>>>
_submitEvent = function() {
sendFormLoginRegister();
};
if (captcha == false) {
$(document).on('click', '#btnLoginRegister', function(s) {
s.preventDefault();
sendFormLoginRegister();
}); //<<<-------- * END FUNCTION CLICK * ---->>>>
}
function sendFormLoginRegister() {
var element = $(this);
$('#btnLoginRegister').attr({
'disabled': 'true'
});
$('#btnLoginRegister').find('i').addClass('spinner-border spinner-border-sm align-middle mr-1');
(function() {
$("#formLoginRegister").ajaxForm({
dataType: 'json',
success: function(result) {
// success
if (result.success == true) {
if (result.isModal && result.isLoginRegister) {
window.location.reload();
}
if (result.url_return && !result.isModal) {
window.location.href = result.url_return;
}
if (result.check_account) {
$('#checkAccount').html(result.check_account).fadeIn(500);
$('#btnLoginRegister').removeAttr('disabled');
$('#btnLoginRegister').find('i').removeClass(
'spinner-border spinner-border-sm align-middle mr-1');
$('#errorLogin').fadeOut(100);
$("#formLoginRegister").reset();
}
} else {
if (result.errors) {
var error = '';
var $key = '';
for ($key in result.errors) {
error += ' ' + result.errors[
$key] + '';
}
$('#showErrorsLogin').html(error);
$('#errorLogin').fadeIn(500);
$('#btnLoginRegister').removeAttr('disabled');
$('#btnLoginRegister').find('i').removeClass(
'spinner-border spinner-border-sm align-middle mr-1');
}
}
},
error: function(responseText, statusText, xhr, $form) {
// error
$('#btnLoginRegister').removeAttr('disabled');
$('#btnLoginRegister').find('i').removeClass(
'spinner-border spinner-border-sm align-middle mr-1');
swal({
type: 'error',
title: error_oops,
text: error_occurred + ' (' + xhr + ')',
});
}
}).submit();
})(); //<--- FUNCTION %
} // End function sendFormLoginRegister
-->