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

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

View File

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