Changeset 624 in tmcsimulator for branches/LCSv2/views/default/submit.html
- Timestamp:
- 08/29/2020 09:03:00 AM (6 years ago)
- File:
-
- 1 edited
-
branches/LCSv2/views/default/submit.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/LCSv2/views/default/submit.html
r623 r624 64 64 startloc.selectedIndex = "0"; 65 65 endloc.selectedIndex = "0"; 66 } 67 /* When a supervisor is selected from the combobox, filter the 68 list of fieldrep (crew) for just those of that supervisor. 69 Note: this function is a near duplicate of routechanged() */ 70 function supervisorchanged() { 71 var e = document.getElementById("supervisorcombo"); 72 var currentSuper = e.options[e.selectedIndex].text; 73 // update the list of crew 74 removeOptions(document.getElementById("fieldrep")); 75 fillCrew(currentSuper); 76 } 77 /* Fill the FieldRep selectbox with items that match supervisor 78 I.e., have the same radio call number. 79 Note: this function is a near duplicate of fillOptions() */ 80 function fillCrew(supervisor) 81 { 82 var i; 83 var tbl = document.getElementById("crewlookup"); 84 var dropdown = document.getElementById("fieldrep") 85 var opt1; 86 87 // Examine all items in crew lookup table 88 for(i = tbl.options.length - 1 ; i >= 0 ; i--) 89 { 90 var item = tbl.options[i].text; 91 // Extract the call num from the lookup table item 92 var currentCallnum = item.substring(0,2); 93 // if the supervisor's call num matches crew call num 94 var superCallnum = supervisor.substring(0,2) 95 if (currentCallnum.startsWith(superCallnum)) 96 { 97 // Add an option to the fieldrep combo box 98 opt1 = document.createElement('option'); 99 opt1.text = opt1.value = item; 100 dropdown.add(opt1,0); 101 } 102 } 103 // Add an empty option to the select box 104 opt1 = document.createElement('option'); 105 opt1.text = opt1.value = ''; 106 dropdown.add(opt1,0); 107 // Show the first (empty) option 108 dropdown.selectedIndex = "0"; 66 109 } 67 110 </script>
Note: See TracChangeset
for help on using the changeset viewer.
