fixing a bug in suborganization handling

This commit is contained in:
David Kennedy 2024-11-15 18:36:16 -05:00
parent 654df17131
commit af10118803
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B

View file

@ -544,19 +544,19 @@ function handlePortfolioSelection() {
* This function ensures the form dynamically reflects whether a specific suborganization is being selected or requested. * This function ensures the form dynamically reflects whether a specific suborganization is being selected or requested.
*/ */
function updateSuborganizationFieldsDisplay() { function updateSuborganizationFieldsDisplay() {
let portfolio_id = portfolioDropdown.val();
let suborganization_id = suborganizationDropdown.val(); let suborganization_id = suborganizationDropdown.val();
if (suborganization_id) { if (portfolio_id && !suborganization_id) {
// Hide suborganization request fields if suborganization is selected
hideElement(requestedSuborganizationField);
hideElement(suborganizationCity);
hideElement(suborganizationStateTerritory);
} else {
// Show suborganization request fields // Show suborganization request fields
showElement(requestedSuborganizationField); showElement(requestedSuborganizationField);
showElement(suborganizationCity); showElement(suborganizationCity);
showElement(suborganizationStateTerritory); showElement(suborganizationStateTerritory);
} else {
// Hide suborganization request fields if suborganization is selected
hideElement(requestedSuborganizationField);
hideElement(suborganizationCity);
hideElement(suborganizationStateTerritory);
} }
} }