{{define "choose_show"}}
    <script>
        $("select.{{.Field}}").on("select2:select", function (e) {
            if (e.params.data.text === {{.Value}} || e.params.data.id === {{.Value}}) {
                {{range $key, $fields := .ChooseFields}}

                $("label[for='{{$fields}}']").parent().show();

                {{end}}
            } else {
                {{range $key, $fields := .ChooseFields}}

                $("label[for='{{$fields}}']").parent().hide();

                {{end}}
            }
        });
        $(function () {
            let {{.Field}}data = $(".{{.Field}}").select2("data");
            let {{.Field}}text = "";
            let {{.Field}}id = "";
            if ({{.Field}}data.length > 0) {
                {{.Field}}text = {{.Field}}data[0].text;
                {{.Field}}id = {{.Field}}data[0].id;
            }
            if ({{.Field}}text === {{.Value}} || {{.Field}}id === {{.Value}}) {
                {{range $key, $fields := .ChooseFields}}

                $("label[for='{{$fields}}']").parent().show();

                {{end}}
            }
        })
    </script>
{{end}}