From 4a7698ed20591441d163a6af95c395a50ed90959 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 17 Mar 2026 14:10:08 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20reset=20all=20org=20form=20fields=20on?= =?UTF-8?q?=20open/close=20=E2=80=94=20stale=20data=20from=20previous=20or?= =?UTF-8?q?g=20was=20polluting=20second=20org=20entry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- portal/templates/app/project.html | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/portal/templates/app/project.html b/portal/templates/app/project.html index 9be774e..e51a3bb 100644 --- a/portal/templates/app/project.html +++ b/portal/templates/app/project.html @@ -1239,14 +1239,28 @@ // ---- Add Party Modal (3-step scrape flow) ---- let scrapedData = null; - function openAddOrgModal() { + function resetAddOrgForm() { scrapedData = null; + // Step 1 document.getElementById('addOrgEmail').value = ''; - document.getElementById('orgRole').value = ''; document.getElementById('scrapeError').classList.add('hidden'); document.getElementById('scrapeLoading').classList.add('hidden'); document.getElementById('scrapeBtn').disabled = false; + // Step 2 — clear all org fields + const clearIds = ['orgName','orgDesc','orgRole','orgIndustry','orgWebsite','orgPhone', + 'orgAddress','orgCity','orgState','orgFounded','orgLinkedIn']; + clearIds.forEach(id => { const el = document.getElementById(id); if (el) el.value = ''; }); + document.getElementById('orgLogoWrap').classList.add('hidden'); + document.getElementById('orgLogoImg').src = ''; + // Step 3 — clear people + const pl = document.getElementById('peopleList'); if (pl) pl.innerHTML = ''; + const np = document.getElementById('noPeople'); if (np) np.classList.remove('hidden'); + // Required field errors requiredFields.forEach(id => document.getElementById(id).classList.remove('field-error')); + } + + function openAddOrgModal() { + resetAddOrgForm(); document.getElementById('addOrgTitle').textContent = 'Add Party'; document.getElementById('addOrgHint').textContent = "Enter an email address or domain name \u2014 we'll look up the organization automatically."; document.getElementById('addOrgSubmitBtn').textContent = 'Add to Deal'; @@ -1415,6 +1429,7 @@ function closeAddOrgModal() { document.getElementById('addOrgModal').classList.add('hidden'); + resetAddOrgForm(); } function showAddOrgStep(n) {