PageSourceSearch

https://www.cn.edu/wp-content/plugins/cnnetpricecalc/assets/js/script.js?ver=1.0.0

js cn.edu collected 2026-09-24 08:39:09 UTC 4,600 bytes, 119 lines download raw bytes

1jQuery(document).ready(function () {
2    //Datepicker
3    jQuery("#netc_birthdate").datepicker(
4        {
5            //showButtonPanel: true,
6            //changeMonth: true,
7            defaultDate:"-18y",
8            changeYear: true,
9            yearRange:"1930:-10",
10            dateFormat: "mm/dd/yy"
11        }
12    );
13    
14    // Opt-in to Bootstrap functionality
15    //jQuery('[data-toggle="tooltip"]').tooltip();
16    //jQuery('[data-toggle="popover"]').popover();
17    
18    //Conditional Form Fields show/hide /////////////////////////
19
20    //  - Create variables
21    var 
22    //    -- Field: Do you have an ACT or SAT score to report?
23    actSatOptionsList = document.getElementById('netc_have_act_sat'),
24    actSatAllTargets = jQuery('.act_sat_option_target'),
25    //    -- Field: Expected Family Contribution 
26    efcOptionsList = document.getElementById('netc_efc_known'),
27    efcAllTargets = jQuery('.efc_known_option_target'),
28    //    -- Field: Independent or Dependent 
29    independentOptionsList = document.getElementById('netc_independent'),
30    independentAllTargets = jQuery('.independent_option_target'),
31    //    -- Field: Student's Marital Status
32    marriedOptionsList = document.getElementById('netc_married'),
33    marriedAllTargets = jQuery('.married_option_target'),
34    //    -- For all fields
35    currentOption,
36    currentTarget;
37    
38    //  - Create Hide and Show Functionality
39    //    -- Field: Do you have an ACT or SAT score to report?
40    function actSatHideShowTargets(){
41        actSatAllTargets.each(function(){
42            this.classList.add('hidden');
43            document.getElementById('netc_act').required=false;
44        });
45        optionIndex = actSatOptionsList.options.selectedIndex; //Find index of selected option when on change
46        currentOption = actSatOptionsList.options[optionIndex].dataset.npcCollapse; //retrieve data-npc-collapse from html
47        currentTarget = document.getElementById(currentOption);
48        if(currentTarget){
49            currentTarget.classList.remove('hidden');
50            document.getElementById('netc_act').required=true;
51        }
52    }
53    //    -- Field: Expected Family Contribution
54    function efcHideShowTargets(){
55        efcAllTargets.each(function(){
56            this.classList.add('hidden');
57        });
58        optionIndex = efcOptionsList.options.selectedIndex;
59        currentOption = efcOptionsList.options[optionIndex].dataset.npcCollapse;
60        currentTarget = document.getElementById(currentOption);
61        if(currentTarget){
62            currentTarget.classList.remove('hidden');
63        }
64    }
65
66    //    -- Field: Independent or Dependent
67    function independentHideShowTargets(){
68        independentAllTargets.each(function(){
69            this.classList.add('hidden');
70        });
71        optionIndex = independentOptionsList.options.selectedIndex;
72        currentOption = independentOptionsList.options[optionIndex].dataset.npcCollapse;
73        currentTarget = document.getElementById(currentOption);
74        if(currentTarget){
75            currentTarget.classList.remove('hidden');
76        }
77        
78    }
79
80    //    -- Field: Student's Marital Status
81    function marriedHideShowTargets(){
82        marriedAllTargets.each(function(){
83            this.classList.add('hidden');
84        });
85        optionIndex = marriedOptionsList.options.selectedIndex;
86        currentOption = marriedOptionsList.options[optionIndex].dataset.npcCollapse;
87        currentTarget = document.getElementById(currentOption);
88        if(currentTarget){
89            currentTarget.classList.remove('hidden');
90        }
91        
92    }
93    
94    //    -- Set Visibility State if User Refreshes Page (skip if results page is active)
95    jQuery(document).ready(function(){
96        if(!jQuery('#netc-results').length >0){
97            actSatHideShowTargets();
98            efcHideShowTargets();
99            independentHideShowTargets();
100            marriedHideShowTargets();
101        }
102    })
103    
104    //    -- Add event listeners for selections (skip if results page is active)
105    if(!jQuery('#netc-results').length >0){
106        actSatOptionsList.addEventListener('change', actSatHideShowTargets);
107        efcOptionsList.addEventListener('change', efcHideShowTargets);
108        independentOptionsList.addEventListener('change', independentHideShowTargets);
109        marriedOptionsList.addEventListener('change', marriedHideShowTargets);
110    }
111    
112    // END Conditional Form Fields show/hide /////////////////////////
113    
114    
115    // Tooltips
116    // $( function() {
117    //   $( document ).tooltip();
118    // } );
119});

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.