<td colspan="2" align="center">
    <h2>{$params_tpl['title']}{$params_tpl['help']}</h2>
    <div style="display: flex; flex-direction: column;">{$tpl_types['field1']}</div>
    <div style="display: flex; flex-direction: column;">{$tpl_types['field2']}</div>
    <div style="display: flex; flex-direction: column;">{$tpl_types['currency']}</div>
    <div style="display: flex; flex-direction: column;" id="div_curname">{$tpl_types['currency_name']}</div>
    <div style="display: flex; flex-direction: column;" id="div_cents">{$tpl_types['cents']}</div>
    <div style="display: flex; flex-direction: column;" id="div_centname">{$tpl_types['cents_name']}</div>
</td>

<script>
    (function() {
        // скрытие полей в зависимости от значений списков
        $('#div_curname').toggle($('select[name="calc_params[{$tpl_num}][currency]').val() == '');
        $('#div_cents').toggle($('select[name="calc_params[{$tpl_num}][currency]').val() == '');
        $('#div_centname').toggle($('select[name="calc_params[{$tpl_num}][currency]').val() == '' && $('select[name="calc_params[{$tpl_num}][cents]').val() == '');
        $('select[name="calc_params[{$tpl_num}][currency]').change(
            function() {
                $('#div_curname').toggle(this.value == '');
                $('#div_cents').toggle(this.value == '');
                $('#div_centname').toggle(this.value == '');
                $('select[name="calc_params[{$tpl_num}][cents]').val(this.value);
            }
        );
        $('select[name="calc_params[{$tpl_num}][cents]').change(
            function() {
                $('#div_centname').toggle(this.value == '');
            }
        );
        // умолчания
        $('input[name="calc_params[{$tpl_num}][currency_name]').prop('placeholder', lang.cur_3);
        $('input[name="calc_params[{$tpl_num}][cents_name]').prop('placeholder', lang.cents_3);
    })();
</script>