<script>
    (function() {
        var versionSelect = $("#form_apiVersion");

        function checkVersionInputs() {
            var apiVersion = parseInt(versionSelect.val());
            switch (apiVersion) {
                case 1:
                    $("#form_DisplayType, #form_AttributeOptions").closest(".form-group").hide();
                    break;
                case 2:
                    $("#form_DisplayType, #form_AttributeOptions").closest(".form-group").show();
                    break;
            }
        }

        versionSelect.change(checkVersionInputs);
        $(document).ready(checkVersionInputs);
    })();
</script>
