<td colspan="2" align="center">
    <h2>{$params_tpl['title']}{$params_tpl['help']}</h2>
    <div style="display: flex; flex-direction: column;">{$tpl_types['gen_field']}</div>
    <div id="add-value{$tpl_num}" style="display: flex; flex-direction: column;">{$tpl_types['add_value']}</div>
</td>
<script>
(function() {
    let genField = $('[name="calc_params[{$tpl_num}][gen_field][field]"]');

    function genFieldChange() {
        let multField = genField.children('option[value="' + genField.val() + '"]').attr('data-mult');
        $('#add-value{$tpl_num}').toggle(multField == '1');
    }

    $(document).ready(genFieldChange);
    genField.change(genFieldChange);
    setTimeout(genFieldChange, 3000);
})();
</script>
