Simplify Officer step: remove count dropdown, officers 2+3 optional
- Removed "How many officers" dropdown — all 3 always visible - Officers 2 and 3 marked as (optional) in legend - Only Officer 1 validated (name, title, street, city required) - Blank optional officers skipped in saved data Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
59c2d06736
commit
6a0162f0a9
1 changed files with 26 additions and 26 deletions
|
|
@ -21,11 +21,11 @@
|
|||
<div id="pw-officer-suggest-list"></div>
|
||||
</div>
|
||||
|
||||
<label class="pw-field">How many officers will you list?</label>
|
||||
<select id="pw-officer-count" class="pw-input">
|
||||
<option value="1">1 — sole proprietor / single officer</option>
|
||||
<option value="2">2 officers</option>
|
||||
<option value="3" selected>3 officers (standard for corp / LLC)</option>
|
||||
<p class="pw-help" style="margin-top:0;font-size:0.82rem;color:#94a3b8;">
|
||||
Fill in Officer 1 (required). Officers 2 and 3 are optional — leave blank if not applicable.
|
||||
</p>
|
||||
<select id="pw-officer-count" class="pw-input" hidden>
|
||||
<option value="3" selected>3</option>
|
||||
</select>
|
||||
|
||||
<fieldset class="pw-fieldset">
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
</fieldset>
|
||||
|
||||
<fieldset class="pw-fieldset" id="pw-o2-wrap">
|
||||
<legend>Officer 2</legend>
|
||||
<legend>Officer 2 <span style="font-weight:400;color:#94a3b8;font-size:0.82rem;">(optional)</span></legend>
|
||||
<div class="pw-row">
|
||||
<div><label class="pw-field">Name</label><input type="text" id="pw-o2-n" class="pw-input" /></div>
|
||||
<div><label class="pw-field">Title</label><input type="text" id="pw-o2-t" class="pw-input" /></div>
|
||||
|
|
@ -63,7 +63,7 @@
|
|||
</fieldset>
|
||||
|
||||
<fieldset class="pw-fieldset" id="pw-o3-wrap">
|
||||
<legend>Officer 3</legend>
|
||||
<legend>Officer 3 <span style="font-weight:400;color:#94a3b8;font-size:0.82rem;">(optional)</span></legend>
|
||||
<div class="pw-row">
|
||||
<div><label class="pw-field">Name</label><input type="text" id="pw-o3-n" class="pw-input" /></div>
|
||||
<div><label class="pw-field">Title</label><input type="text" id="pw-o3-t" class="pw-input" /></div>
|
||||
|
|
@ -105,12 +105,8 @@
|
|||
const o3wrap = g<HTMLElement>("pw-o3-wrap");
|
||||
const err = g<HTMLDivElement>("pw-officer-err");
|
||||
|
||||
function syncCount() {
|
||||
const n = Number(count.value);
|
||||
o2wrap.hidden = n < 2;
|
||||
o3wrap.hidden = n < 3;
|
||||
}
|
||||
count.addEventListener("change", syncCount);
|
||||
// All 3 officer sections always visible — 2 & 3 are optional
|
||||
function syncCount() {};
|
||||
|
||||
function officerFields(i: number) {
|
||||
return {
|
||||
|
|
@ -211,22 +207,26 @@
|
|||
window.addEventListener("pw:step-next", (evt: any) => {
|
||||
const PW = (window as any).PWIntake;
|
||||
if (PW.steps[PW.get().step_index] !== "officer") return;
|
||||
const n = Number(count.value);
|
||||
const officers: any[] = [];
|
||||
const missing: string[] = [];
|
||||
for (let i = 1; i <= n; i++) {
|
||||
for (let i = 1; i <= 3; i++) {
|
||||
const f = officerFields(i);
|
||||
if (!f.n.value.trim()) missing.push(`Officer ${i} name`);
|
||||
if (!f.t.value.trim()) missing.push(`Officer ${i} title`);
|
||||
// Address required for 499-A flows (not enforced for sole_prop)
|
||||
if (!f.street.value.trim()) missing.push(`Officer ${i} street`);
|
||||
if (!f.city.value.trim()) missing.push(`Officer ${i} city`);
|
||||
officers.push({
|
||||
name: f.n.value.trim(), title: f.t.value.trim(),
|
||||
email: f.e?.value.trim() || "", phone: f.p?.value.trim() || "",
|
||||
street: f.street.value.trim(), city: f.city.value.trim(),
|
||||
state: f.state.value.trim().toUpperCase(), zip: f.zip.value.trim(),
|
||||
});
|
||||
if (i === 1) {
|
||||
// Officer 1 is required
|
||||
if (!f.n.value.trim()) missing.push("Officer 1 name");
|
||||
if (!f.t.value.trim()) missing.push("Officer 1 title");
|
||||
if (!f.street.value.trim()) missing.push("Officer 1 street address");
|
||||
if (!f.city.value.trim()) missing.push("Officer 1 city");
|
||||
}
|
||||
// Only include officer if name is filled (skip blank optional officers)
|
||||
if (f.n.value.trim()) {
|
||||
officers.push({
|
||||
name: f.n.value.trim(), title: f.t.value.trim(),
|
||||
email: f.e?.value.trim() || "", phone: f.p?.value.trim() || "",
|
||||
street: f.street.value.trim(), city: f.city.value.trim(),
|
||||
state: f.state.value.trim().toUpperCase(), zip: f.zip.value.trim(),
|
||||
});
|
||||
}
|
||||
}
|
||||
if (missing.length) {
|
||||
err.hidden = false; err.textContent = `Required: ${missing.join(", ")}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue