<td colspan="2" align="center">
    <h2>{$params_tpl['title']}{$params_tpl['help']}</h2>
    <div style="display: flex; flex-direction: column;">{$tpl_types['sourse_url']}</div>
    <div style="display: flex; flex-direction: column;" id="site_url{$tpl_num}">{$tpl_types['site_url']}</div>
    <div style="display: flex; flex-direction: column;" id="url_field{$tpl_num}">{$tpl_types['url_field']}</div>
    <div style="display: flex; flex-direction: column;">{$tpl_types['res_field']}</div>
</td>
<script>
function change_sourse_url() {
    if ($('[name="calc_params[{$tpl_num}][sourse_url]"]').val() == 1) {
        $('#site_url{$tpl_num}').css('display', 'flex');
        $('#url_field{$tpl_num}').css('display', 'none');
    } else {
        $('#site_url{$tpl_num}').css('display', 'none');
        $('#url_field{$tpl_num}').css('display', 'flex');
    }
};
$('[name="calc_params[{$tpl_num}][sourse_url]"]').change(change_sourse_url);
$(change_sourse_url);
</script>