ERR FIX: наложение фильтров 2

This commit is contained in:
e-serg 2024-04-15 13:34:00 +03:00
parent 8cbbd15829
commit 04c204fc57

View File

@ -82,27 +82,12 @@
{% block JS_1 %}<script type="text/javascript"> {% block JS_1 %}<script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('#type').change(function(){ $('#type,#sex').change(function(){
let t = $(this).find("option:selected").attr('value');
let s = $('#sex').find("option:selected").attr('value');
if (t === 'tA')
$('tbody > tr').show();
else {
$('tbody > tr').hide();
$('tbody > tr.' + t).show();
}
if(s !== 'sA') $('tbody > tr:not(.' + s +')').hide();
});
$('#sex').change(function(){
let s = $(this).find("option:selected").attr('value');
let t = $('#type').find("option:selected").attr('value'); let t = $('#type').find("option:selected").attr('value');
if (s === 'sA') let s = $('#sex').find("option:selected").attr('value');
$('tbody > tr').show(); $('tbody > tr').show();
else { if(t !== 'tA') $('tbody > tr:not(.'+t+')').hide();
$('tbody > tr').hide(); if(s !== 'sA') $('tbody > tr:not(.'+s+')').hide();
$('tbody > tr.' + s).show();
}
if(s !== 'tA') $('tbody > tr:not(.' + t + ')').hide();
}); });
}); });
</script>{% endblock %} </script>{% endblock %}