
Conditional Portal Forms: Keep Branching Questions and Server Validation in Agreement
Design conditional portal forms with explicit branch rules, deliberate hidden-value handling, accessible changes, and authoritative server validation.
Custom Portals
Keep cascading portal choices valid across parent changes, delayed responses, account permissions, and saved-record edits.

LET’S BUILD SOMETHING USEFUL
Talk to ATARAXY DEVELOPERS (SMC-PRIVATE) LIMITED about your website, app, or custom software.
A customer selects a company and then a project within that company. Before the project list finishes loading, they switch companies. The old response arrives last, and the screen shows projects from the previous company beneath the new company name. If the form submits only the visible project identifier, the resulting request may be inconsistent or expose the wrong customer’s information.
Dependent selectors need a relationship contract, not just a pair of dropdowns. The parent determines the allowed child set, asynchronous requests must remain tied to that parent, and the server must validate the relationship again when saving. The interface should explain loading, empty, unavailable, and invalid states without erasing unrelated work.
List the rules that qualify a project for selection: it belongs to the chosen company, is active for the requested workflow, and is visible to the current user. There may be additional constraints, such as service type or contract period. Keep these rules in one reviewed application contract so that the dropdown and the save endpoint do not drift apart.
Use stable identifiers for parent and child records. Display names are useful to people, but two companies can have projects called Website update. Include enough secondary context to distinguish options without exposing unnecessary information. A label should help the user choose the intended record while the identifier preserves its actual identity.
Before a parent is chosen, the child control can explain Select a company first. During loading, show a specific progress message. An empty eligible set should say that no projects are available for the selected company. A request failure should offer a retry rather than pretending that the list is empty.
Keep the states distinct in code and in the interface. If a network error is rendered as No projects, users may create duplicate project requests or contact the wrong team. If an empty state looks like a permanent loading spinner, they may wait indefinitely. Each state needs an explanation and a reasonable next action.
When the parent changes, review the existing child selection immediately. Usually it must be cleared or marked as needing validation before submission. Do not retain a hidden project identifier while merely replacing its visible label with a placeholder. That creates a form that looks incomplete but still sends an old value.
If the business allows a child to remain valid under several parents, verify that relationship before preserving it. Explain the result to the user. The safe behavior comes from the eligibility rule, not from assuming that all parent changes require deletion or that a familiar label proves the selected record still belongs in the new context.
Associate a load request with the parent identifier, relevant filters, account context, and a request generation. When a response arrives, apply it only if those values still match the current selection context. Cancelling an old request can reduce unnecessary work, but the response guard is still useful when cancellation arrives too late or another asynchronous step has already completed.
Test the order deliberately: load company A, switch to company B, return B’s response first, and return A’s response afterward. The screen must keep B’s choices. Repeat with a failed old request and a successful current request; an obsolete error should not replace the valid list or show a misleading failure banner.
A native select is often sufficient for a small list. Larger lists may need a search control, but a custom combobox brings keyboard and accessibility responsibilities. The WAI-ARIA combobox pattern describes behavior and semantics for different selection and autocomplete models. Choose a pattern that matches whether arbitrary text is allowed or a known record must be selected.
Keep typed search text separate from an accepted record identifier. Typing Website update should not silently select whichever matching project appears first. Announce useful result and loading information without interrupting every keystroke. Test keyboard acceptance, escape behavior, focus movement, and the displayed value after the parent changes.
The server must verify the submitted parent-child pair, current account, permissions, and relevant lifecycle state. A client can be stale or modified, and an option may become unavailable after it was displayed. Reject inconsistent pairs with an error that helps the user correct the specific selection while preserving other valid form fields.
Do not repair the pair silently by switching the parent to match the child. That can move the request into another customer’s context without the user’s informed choice. If the product offers a correction suggestion, display it explicitly and require the appropriate confirmation. Keep authorization checks in force for both the original and proposed context.
An older request may reference a project that is now archived. Decide whether the portal should display that historical value, require a new choice for certain edits, or allow the existing relationship to remain unchanged. A selector that loads only active options can otherwise make the saved record appear blank or replace it with the first available option.
Show an unavailable historical selection clearly, with the reason appropriate to the user’s permissions. Preserve the distinction between viewing history and selecting a record for new work. When cloning a request, revalidate the relationship under the new workflow rather than copying the old hidden identifiers without review.
If child lists are cached, include the parent and relevant authorization context in the cache key. Invalidate or refresh when access changes. A cache entry for one company or user should not populate another person’s selector merely because the search text is identical. Minimize the information returned for each option to what selection actually needs.
For paginated search results, keep the cursor tied to the same parent and query. Reset it when those inputs change, and distinguish loading another page from refreshing the initial set. A selected project should remain identifiable even if it is not on the currently loaded page. Do not infer that it is invalid merely because it is outside the first page of results.
AI may suggest a project from a message, but treat the suggestion as a candidate within the current parent’s permitted set. Show enough context for the user to confirm it. Never let a text match bypass the same relationship and authorization checks applied to a manual selection.
Test slow responses, no matches, repeated parent changes, revoked access, archived children, duplicate display names, and saved-record editing. Inspect the actual payload and server record after each test. The important evidence is that the stored parent-child relationship matches the reviewed selection, not merely that the dropdown displayed an attractive label.
Dependent portal selectors work reliably when eligibility, asynchronous state, and server validation describe the same relationship. Bind responses to their original context, invalidate stale selections deliberately, and preserve useful feedback during failure and editing. The final saved record should reflect a choice the user could understand and the server could verify.
LET’S BUILD SOMETHING USEFUL
Talk to ATARAXY DEVELOPERS (SMC-PRIVATE) LIMITED about your website, app, or custom software.