From 0eeee88f1c79b426049cfc40d69a2ce9b2c2715d Mon Sep 17 00:00:00 2001 From: David Kennedy Date: Thu, 2 Jan 2025 11:40:17 -0500 Subject: [PATCH] hide 'other' for portfolios without suborganizations --- src/registrar/assets/src/js/getgov/requesting-entity.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/registrar/assets/src/js/getgov/requesting-entity.js b/src/registrar/assets/src/js/getgov/requesting-entity.js index 4e7cf8276..2f8c842a7 100644 --- a/src/registrar/assets/src/js/getgov/requesting-entity.js +++ b/src/registrar/assets/src/js/getgov/requesting-entity.js @@ -26,7 +26,12 @@ export function handleRequestingEntityFieldset() { function toggleSuborganization(radio=null) { if (radio != null) requestingSuborganization = radio?.checked && radio.value === "True"; requestingSuborganization ? showElement(suborgContainer) : hideElement(suborgContainer); - requestingNewSuborganization.value = requestingSuborganization && select.value === "other" ? "True" : "False"; + if (select.options.length == 2) { // --Select-- and other are the only options + hideElement(selectParent); // Hide the select drop down and indicate requesting new suborg + requestingNewSuborganization.value = "True"; + } else { + requestingNewSuborganization.value = requestingSuborganization && select.value === "other" ? "True" : "False"; + } requestingNewSuborganization.value === "True" ? showElement(suborgDetailsContainer) : hideElement(suborgDetailsContainer); }