Высота | 175 |
Довжина | 242 |
Емкость, Ah | 53 |
Напряжение, V | 12V |
Полярность | ПРАВ {11}$/;
mark($(this), !reg.test($.trim($(this).val())));
break;
case "pass":
password = true;
reg = /^[(a-zA-Z0-9)|(_@$!%*#?&.;:)]{6,}$/;
mark($(this), !reg.test($.trim($(this).val())));
password = false;
break;
case "pass1":
mark($(this), pass_1 !== pass || $.trim($(this).val()).length === 0);
break;
default:
reg = new RegExp($(this).attr("data-validate"), "g");
mark($(this), !reg.test($.trim($(this).val())));
break;
}
});
$('.js_valid_radio').each(function () {
var inp = $(this).find('input.required');
var rezalt = 0;
for (var i = 0; i < inp.length; i++) {
if ($(inp[i]).is(':checked') === true) {
rezalt = 1;
break;
} else {
rezalt = 0;
}
}
if (rezalt === 0) {
$(this).addClass(error_class).removeClass(norma_class);
e = 1;
} else {
$(this).addClass(norma_class).removeClass(error_class);
}
});
e += form.find("." + error_class).length;
if (e == 0) {
if(form.attr('name') == "sign_in" ||
form.attr('name') == "register" ||
form.attr('name') == "password_ress") {
let modall = form.parents('.modal');
$(modall).find('.cssload-container').addClass('active');
send_form_fun(form, modall);
}
return true;
} else {
$('.js_alert_error').show();
setTimeout(function () {
$('.js_alert_error').hide();
}, 4000);
form.find('.error input:first').focus();
return false;
}
}
function send_form_fun(goform, modal) {
let form = goform,
url = form.data('formaction'),
naw_y = new Date().getUTCFullYear(),
naw_m = new Date().getUTCMonth(),
msg = form.serialize()+'&year='+naw_y+'&month='+naw_m;
$.ajax({
type: 'POST',
url: url,
data: msg,
success: function (json) {
$(modal).find(".cssload-container").removeClass('active');
$('.modal').modal('hide');
form[0].reset();
location.reload();
},
error: function (json) {
console.log('error send_PermitsReport',json);
$(modal).find(".error_wr").remove();
$(modal).find(".modal-body").append(' '+ json['responseJSON'].message +' ');
$(modal).find(".cssload-container").removeClass('active');
},
});
}
$(document).on('click', '.js_show_pass', function () {
let el = $(this),
input_pass = $(el).next('input'),
input_type = $(input_pass).attr("type"),
ico = $(this).find('.fa');
if(input_type == "password") {
$(input_pass).attr("type","text");
$(ico).attr("class", "fa fa-eye-slash");
} else {
$(input_pass).attr("type","password");
$(ico).attr("class", "fa fa-eye");
}
});
$(document).on("keyup", ".form-group .js_keyboard_layout", function() {
isCyrillic ($(this).val());
console.log( isCyrillic ($(this).val()));
let parent = $(this).parents('.input-field');
if(isCyrillic ($(this).val())) {
$(parent).addClass('error');
$(parent).find('.js_keyboard_layout_text').remove();
$(parent).append('Сheck keyboard layout ')
} else {
$(parent).removeClass('error');
$(parent).find('.js_keyboard_layout_text').remove();
}
});
function isCyrillic(str) {
return /[а-я]/i.test(str);
}
|