Вход Регистрация
Файл: zyro/js/main.js
Строк: 87
<?php
function wb_form_validateForm(formIdvalueserrors) {
    var 
form = $("input[name='wb_form_id'][value='" formId "']").parent();
    if (!
form || form.length === || !errors) return;
    
    
form.find("input[name],textarea[name]").css({backgroundColor""});
    
    if (
errors.required) {
        for (var 
0errors.required.lengthi++) {
            var 
name errors.required[i];
            var 
elem form.find("input[name='" name "'],textarea[name='" name "'],select[name='" name "']");
            
elem.css({backgroundColor"#ff8c8c"});
        }
    }
    
    if (
Object.keys(errors).length) {
        for (var 
k in values) {
            var 
elem form.find("input[name='" "'],textarea[name='" "'],select[name='" "']");
            
elem.val(values[k]);
        }
    }
}

$(function() {
    var 
comboBoxes = $('.wb-combobox-controll');
    if (
comboBoxes.length) {
        
comboBoxes.each(function() {
            var 
thisCombo = $(this);
            var 
clickFunc = function() {
                var 
thisCombo.find('input').outerWidth();
                var 
mw = (menu thisCombo.find('.dropdown-menu')).width();
                var 
ew thisCombo.parent().outerWidth();
                if (
mw ewmenu.width(ew);
                
menu.css({ marginLeft: (-w) + 'px' });
                
thisCombo.find('.btn-group').toggleClass('open');
            };
            $(
this).find('input').bind('click'clickFunc);
            $(
this).find('.dropdown-toggle').bind('click'clickFunc);
        });
        
        $(
document).bind('click', function(e) {
            var 
= $(e.target);
            if (!
t.is('.wb-combobox-controll')) {
                
t.parents('.wb-combobox-controll');
                $.
each($('.wb-combobox-controll'), function() {
                    if (
t.get(0) !== $(this).get(0)) {
                        $(
this).find('.btn-group').removeClass('open');
                    }
                });
            }
        });
    }
    
    if (
currLang) {
        $(
'.lang-selector').each(function() {
            var 
thisElem = $(this);
            var 
type thisElem.attr('data-type');
            if (
type == 'flags') {
                
thisElem.find('a[data-lang="' currLang '"]').addClass('active');
            } else if (
type == 'select') {
                var 
actLi thisElem.find('li[data-lang="' currLang '"]');
                
actLi.addClass('active');
                
thisElem.find('input').val(actLi.find('a').html());
            }
        });
    }
});
?>
Онлайн: 1
Реклама