Marthee commited on
Commit
ef7e520
·
verified ·
1 Parent(s): a5fcdee

Update templates/proposed-GUI.html

Browse files
Files changed (1) hide show
  1. templates/proposed-GUI.html +28 -1
templates/proposed-GUI.html CHANGED
@@ -1872,6 +1872,8 @@ function getSelectValues(select) {
1872
 
1873
  //Retrieves list of projects
1874
  var doorSchedulePDF;
 
 
1875
  function getproj(){
1876
  getALLMCTNAMES();
1877
 
@@ -1968,6 +1970,30 @@ var doorSchedulePDF;
1968
 
1969
  // Action for when the checkbox is clicked
1970
  function handleCheckboxChange(event) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1971
  // Uncheck all checkboxes before checking the current one
1972
  document.querySelectorAll('input[name="measureCheckbox"]').forEach(checkbox => {
1973
  checkbox.checked = false;
@@ -2006,6 +2032,7 @@ var doorSchedulePDF;
2006
 
2007
  console.log(projsec.value)
2008
  if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) {
 
2009
  document.getElementById("all").style.display = "block";
2010
 
2011
  pixelArr=[projname.value, projpart.value,projsec.value, pdfname]
@@ -2725,7 +2752,7 @@ function getData(form) {
2725
  }
2726
  else if (formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('2.6') )
2727
  {
2728
- answers.push(tomeasureproj, 0,[] , 0,0,pdfpath , doorSchedulePDF,groupedValues);
2729
  formData.append('answers',JSON.stringify(answers))
2730
  }
2731
  }
 
1872
 
1873
  //Retrieves list of projects
1874
  var doorSchedulePDF;
1875
+ let selectedValues = []; // global
1876
+
1877
  function getproj(){
1878
  getALLMCTNAMES();
1879
 
 
1970
 
1971
  // Action for when the checkbox is clicked
1972
  function handleCheckboxChange(event) {
1973
+ if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) {
1974
+ // Uncheck all checkboxes before checking the current one
1975
+ document.querySelectorAll('input[name="measureCheckbox"]').forEach(checkbox => {
1976
+ if (checkbox !== event.target) {
1977
+ checkbox.checked = false;
1978
+ }
1979
+ });
1980
+ }
1981
+ // Check the current checkbox
1982
+ const selectedCheckboxes = Array.from(document.querySelectorAll('input[name="measureCheckbox"]:checked'));
1983
+ selectedValues = selectedCheckboxes.map(cb => cb.value);
1984
+ measSelect.value = selectedValues.join(', ');
1985
+
1986
+ console.log("Selected projects:", selectedValues);
1987
+
1988
+ // Save the latest selected checkbox PDF name (if only one selected)
1989
+ pdfname = selectedValues.length === 1 ? selectedValues[0] : selectedValues.join(', ');
1990
+ // Highlight the selected item
1991
+ document.querySelectorAll(".measure-item").forEach(item => {
1992
+ const checkbox = item.querySelector('input[name="measureCheckbox"]');
1993
+ item.style.backgroundColor = checkbox.checked ? '#d3f8d3' : '';
1994
+ });
1995
+ console.log("Selected projects:", selectedValues);
1996
+
1997
  // Uncheck all checkboxes before checking the current one
1998
  document.querySelectorAll('input[name="measureCheckbox"]').forEach(checkbox => {
1999
  checkbox.checked = false;
 
2032
 
2033
  console.log(projsec.value)
2034
  if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) {
2035
+ pdfname = selectedValue;
2036
  document.getElementById("all").style.display = "block";
2037
 
2038
  pixelArr=[projname.value, projpart.value,projsec.value, pdfname]
 
2752
  }
2753
  else if (formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('2.6') )
2754
  {
2755
+ answers.push(selectedValues, 0,[] , 0,0,pdfpath , doorSchedulePDF,groupedValues);
2756
  formData.append('answers',JSON.stringify(answers))
2757
  }
2758
  }