<td colspan="2" align="center">
    <h2>{$params_tpl['title']}{$params_tpl['help']}</h2>
    <div class="flex-field" style="display: flex; flex-direction: column; ">{$tpl_types['field1']}</div>
    <div class="flex-result" style="display: flex; flex-direction: column;">{$tpl_types['result']}</div>
    <div class="func-row" style="display: flex; flex-direction: column; ">{$tpl_types['func_row']}</div>
    <div class="case-value" style="display: flex; flex-direction: column;">{$tpl_types['case_value']}</div> 
    <div class="flex-data" style="display: none; align-items: center ">{$tpl_types['flex_data']}</div>
</td>
<script>
(function() {
    var funcRow = $('textarea[name="calc_params[{$tpl_num}][func_row]"]');
    funcRow.change(function(e) {
        document.getElementsByName('calc_params[{$tpl_num}][flex_data]')[0].value = funcRow.val();
    });

    if (document.getElementsByName('calc_params[{$tpl_num}][func_row]')[0].value == "") {
        document.getElementsByName('calc_params[{$tpl_num}][func_row]')[0].value = "{literal}{Фамилия} {Имя} {Отчество}{/literal}";
        document.getElementsByName('calc_params[{$tpl_num}][flex_data]')[0].value = "{literal}{Фамилия} {Имя} {Отчество}{/literal}";
    }
})();
</script>
