PageSourceSearch

https://bloxhamsurgery.co.uk/Scripts/Pages/form-builder.js

js bloxhamsurgery.co.uk collected 2026-10-02 22:52:37 UTC 2,992 bytes, 83 lines download raw bytes

1$(function () {
2    // Select form/survey from edit menu
3    selectionChange();
4
5    $("#FormPage")
6        // DropDownList
7        .on("change", "select", function () {
8            var defaultOtherId = $(this).data("other");
9            var currentSelectedId = this.value;
10            var otherOption = $(this).closest('.other-dropDownList').find('.other-option-text');
11
12            if (defaultOtherId == currentSelectedId) {
13                otherOption
14                    .attr("aria-hidden", "false")
15                    .addClass("show");
16            }
17            else {
18                otherOption
19                    .attr("aria-hidden", "true")
20                    .removeClass("show");
21            }
22        })
23
24        // Checkbox
25        .on("change", "input[type=checkbox]", function () {
26            var defaultOtherId = $(this).data("other");
27
28            var otherOptionText = $(this).closest('.other-checkbox').find('.other-option-text');
29            var otherCheckbox = $(this).closest('.other-checkbox').find("input[value='" + defaultOtherId + "']");
30
31            if (otherCheckbox.is(":checked")) {
32                otherOptionText
33                    .attr("aria-hidden", "false")
34                    .addClass("show");
35            } else {
36                otherOptionText
37                    .attr("aria-hidden", "true")
38                    .removeClass("show");
39            }
40        })
41
42        // RadioButtonList
43        .on("change", "input[type=radio]", function () {
44            var defaultOtherId = $(this).data("other");
45            var currentSelectedId = $(this).val();
46            var otherOption = $(this).closest('.other-radioButtonList').find('.other-option-text');
47
48            if (defaultOtherId == currentSelectedId) {
49                if ($(this).is(':checked')) {
50                    otherOption
51                        .attr("aria-hidden", "false")
52                        .addClass("show");
53                }
54                else {
55                    otherOption
56                        .attr('aria-hidden', "true")
57                        .removeClass("show");
58                }
59            }
60            else {
61                otherOption
62                    .attr('aria-hidden', "true")
63                    .removeClass("show");
64            }
65        });
66
67    //DW: I'm not prud of this... who am i kidding, I'm a bit proud of this!
68    $(document).on("change", ".other-checkbox .checkbox input", function () {
69        var selectedValues = $(this).closest(".other-checkbox").find(".checkbox input:checked").map(function (index, item) {
70            return $(item).val();
71        });
72
73        var answer = selectedValues.toArray().join(",");
74        $(this).closest(".other-checkbox").find(".hidden-answer").val(answer);
75    });
76});
77
78function selectionChange() {
79    var pageEditor = $(".form-new");
80    if (pageEditor != null) {
81        pageEditor.show();
82    }
83}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.