The Form Worked. The User Still Left.

2026-12-01来源 dev.toEnglish
The Form Worked. The User Still Left.

A practical engineering investigation into why technically functional forms frustrate users, and how to build better ones with Angular and React.

You have probably encountered a form that made you question your entire existence.

A dropdown does not contain your answer. A name field rejects your perfectly valid name. You submit the form, something goes wrong, and suddenly your carefully typed information vanishes.

I envy your life if this has not happened to you.

Somewhere, a developer is proudly announcing that the form works, and technically, they are right. The required fields are validated, the submit button responds to clicks, and the API receives the request.

The application behaves exactly as the code says it should. Unfortunately, the user is not trying to satisfy the code. They are trying to get something done.

That distinction is where things get interesting.

As engineers, we spend considerable time making sure our forms accept valid input, reject invalid input, and submit data correctly. These are important responsibilities. But they are not the whole story.

  • What happens when the user has a legitimate answer that our dropdown does not support?
  • What happens when our validation rules reject a name that has existed perfectly happily for decades?
  • What happens when a temporary submission failure destroys several minutes of someone's effort?

A form can be technically correct and still make the user work unnecessarily hard. And unlike a compiler, users do not always give us a helpful error message before they leave.

This article investigates the gap between the form works and the form works for the person using it.

I'll look at six common form UX problems, reproduce them in deliberately poor implementations, and improve each one using practical engineering decisions. I built the examples in both Angular and React, not to declare a winner, but to show that the underlying UX principles are bigger than our choice of framework.

The goal isn't to make forms look clever, but to help people get things done.

The implementations are available in the form-ux-study repository. You can explore the Angular and React versions, compare the approaches, and experiment with the improvements yourself.

I built a form

Complaining about bad forms is easy. I wanted to go a little further than pointing at a frustrating interface.

I wanted to investigate the engineering decisions behind the frustration. So I built a fictional job application form.

A candidate provides their name and contact details, selects a role, shares some information about their experience, and submits an application. There is a resume upload, a few validation rules, and a mock submission process.

I implemented it twice, in Angular and React, and then deliberately made things worse. Not by breaking the application or throwing random errors at it, but by introducing specific UX problems that could easily appear in a real application, while keeping the form technically functional enough to demonstrate the issue.

For each problem, I created two versions:

  • The poor implementation: Reproduces the frustrating experience.
  • The improved implementation: Addresses the specific problem with a better engineering decision.

The purpose isn't to compare frameworks. Angular and React are simply the two implementation environments for this investigation. The question is whether we, as engineers, make decisions that help or hinder the people using our applications.

Not every frustration is equally severe

One thing becomes clear as we look at the examples: not every UX problem deserves the same level of attention.

  • A slightly awkward spacing between fields is not the same as a form that prevents someone from submitting an accurate application.
  • A button that could look better is not the same as a submission failure that silently destroys the user's work.

So we need a severity framework to help us reason about impact.

  • Critical: The problem blocks accurate completion, falsely signals success, causes severe unrecoverable loss, or creates a major accessibility barrier.
  • High: The problem causes substantial confusion, rework, or a strong likelihood of abandonment.
  • Moderate: The problem introduces avoidable friction, but users can generally recover.
  • Low: The problem is primarily a matter of polish or minor convenience.

Severity describes the impact on the user. Priority is a separate decision: how urgently should we address the issue, considering how often it occurs and how many people are exposed to it?

These classifications are my assessment of the potential user impact in this particular application. They are not empirically measured scores or universal UX ratings. The severity of an issue will depend on its context, the people affected, and whether a reasonable alternative exists.

Here is how I would classify the six scenarios in this investigation:

Severity UX mistake Why it matters
Critical Keyboard-inaccessible required upload Some users may be unable to complete the application.
Critical Failed submission destroys entered data A recoverable failure becomes severe loss of user effort.
High Required dropdown has no accurate answer Users may be forced to misrepresent themselves or abandon the form.
High Restrictive name validation Legitimate users can be blocked by arbitrary input rules.
High No submission-state feedback Users are uncertain whether an operation is underway and may submit repeatedly.
High No draft recovery Interruptions can force users to repeat substantial work.

Six ways a technically functional form can fail its user

Before diving into the individual examples, here is a quick overview of what I set out to fix.

The six problems and the engineering decisions used to address them.

Figure: The six problems and the engineering decisions used to address them.

Let's get into it.

1. The dropdown that knows your career better than you do

Imagine applying for a software engineering position.

You reach the field asking for your current role. You open the dropdown and find:

  • Junior Software Engineer
  • Senior Software Engineer
  • Engineering Manager

You are a Staff Engineer.

You scroll up. You scroll down. You even consider whether "Engineering Manager" might be close enough. It isn't.

There is no option for your role, and the field is required. You cannot submit the application without selecting an answer, but none of the available answers is accurate.

Congratulations. You have encountered a form that has made a career decision on your behalf.

The problem

In our poor implementation, the role dropdown contains a limited list of positions. Some legitimate roles are missing, and there is no alternative option.

The field is required, so the browser correctly prevents submission when nothing is selected.

From a validation perspective, everything is working as intended. From the candidate's perspective, however, the form has created a dead end.

The candidate must either choose an inaccurate answer, abandon the application, or find some workaround that the form never intended.

This is a good example of why validation alone cannot guarantee a good user experience. We can validate that a user selected an option, but we cannot assume that the selected option accurately represents their situation.

The improvement: Give the user an escape route

The improved dropdown adds an Other / not listed option.

When the candidate selects it, a text field appears so they can provide their actual role.

The alternative answer is retained as part of the submitted response, rather than simply allowing the candidate to bypass the required field.

Adding an "Other" option without providing a way to explain the answer would only move the frustration somewhere else. The user would be allowed to proceed, but the information collected would still be incomplete.

The improved version gives the candidate a way to answer accurately.

GIF showing dropdown implementation

The engineering lesson

A dropdown is useful when the available options represent the user's possible answers.

The moment we make that dropdown required, we take on a responsibility. We must provide a valid path for users whose answers do not fit our predefined options.

That does not mean every dropdown needs an "Other" option. Sometimes a controlled list is necessary, and sometimes an alternative answer would be inappropriate.

It does mean we should ask ourselves:

  • Are these options genuinely exhaustive?
  • What happens when a legitimate answer is missing?
  • Can the user still complete the task accurately?
  • If we offer an alternative, do we capture enough information to make it useful?

The improved implementation is not complicated. It is a small change to the form's logic and structure.

It changes the experience from "choose an answer that does not describe you" to "tell us what we missed," and that is a much better way to start an application.

2. Your name is invalid. Please try being someone else.

Let's say the candidate enters Amara O'Brien in the name field. They click Continue, and the form responds with "Please enter a valid name."

Amara is probably wondering what exactly is wrong with her name.

In our poor implementation, the name field uses a restrictive validation rule that accepts only ASCII letters and spaces. Apostrophes are rejected.

The developer may have intended to prevent numbers and unusual characters from appearing in the name field, which sounds reasonable at first.

However, the rule does not distinguish between genuinely invalid input and legitimate names that simply do not fit the developer's assumptions.

The problem

Names are not uniform strings of English letters. They may contain apostrophes, hyphens, accented characters, and other characters that are perfectly valid in a person's name.

A validation rule that assumes otherwise can reject real people before they even reach the next step.

The frustrating part? The form is not rejecting the name because it is necessarily incorrect. It is rejecting it because the developer chose a narrow definition of what a name should look like.

We have effectively turned a text field into an identity checkpoint.

The improvement: Validate the input, not the developer's assumptions

For the improved version, I relaxed the validation rule.

The field accepts names containing letters, spaces, apostrophes, and hyphens, including non-English letters.

We still validate that the name is required and reject whitespace-only input. We are not simply removing validation altogether.

The difference is that the validation now focuses on the actual requirement: the candidate must provide a name.

It no longer tries to enforce one particular naming convention.

GIF showing name validation implementation

The engineering lesson

Validation should protect the quality of the data we need, not enforce assumptions that are unrelated to the user's task.

Before writing a restrictive validation rule, ask:

  • What information do we actually need from this field?
  • Are we rejecting legitimate values because they are unfamiliar?
  • Is the restriction required by the business or technical contract?
  • Could a less restrictive rule achieve the same goal?

There are fields where strict validation is necessary. Email addresses, dates, identifiers, and other structured values have specific requirements.

A person's name does not need to obey the naming conventions of our codebase.

If your regex rule rejects Amara O'Brien, perhaps the problem is not Amara's name.

3. Something went wrong. So we deleted your hard work.

You have spent the last fifteen minutes filling out a job application. Your name, contact details, professional experience, resume, and that carefully worded statement explaining why you are the right candidate.

You click Submit but get the response Something went wrong.

You try to understand what happened. Was it your internet connection? Did the server reject the request? Was there a problem with the application?

The form offers no useful explanation. You look at the fields. They're empty. Everything you entered is gone.

The problem

In our poor implementation, a failed submission triggers a generic error message and clears the application form. Instead of helping the candidate recover, it discards their input.

There are two separate problems here. First, the error message does not tell the user what happened or what they should do next. Second, clearing the form turns a potentially recoverable submission failure into lost work.

The user is now left guessing whether their application was submitted, whether they should try again, or whether they need to start from scratch.

A failure should not automatically become a punishment.

The improvement: Make failure recoverable

I changed the behavior in the improved implementation. When the mock submission fails, the form now communicates something important:

  • Your application was not submitted. Please try again.

Instead of displaying an ambiguous error, I tell the candidate the outcome of the attempt. I also preserve everything they entered.

The error is presented in an accessible alert, the candidate is directed to it, and a clear Retry submission action is provided.

The user does not need to reconstruct their application. They can address the problem and try again.

This is a relatively small implementation change, but it fundamentally changes how the application handles failure.

GIF showing submission error implementation

The engineering lesson

We often spend considerable effort designing the happy path. The user fills in the form, clicks Submit, and everything succeeds. However, real applications also need to handle the unhappy paths. A network request can fail. A service can become temporarily unavailable. A request can be rejected.

When that happens, we should consider three things:

  • Clarity: Does the user understand what happened?
  • Recovery: Do they know what to do next?
  • Preservation: Have we retained the information they already provided?

There is also an important distinction between a failed request and an unknown outcome. Our demonstration uses a deterministic server-error outcome, so we can confidently communicate that the application was not submitted. A timeout or lost response in a real application may leave the outcome uncertain, and the interface should not claim that nothing was submitted unless it can establish that.

The broader principle remains: when something goes wrong, help the user recover instead of making them start over.

4. Is it submitting, or should I click again?

You fill in the application, double-check your details, and click Submit, but nothing happens.

The interface gives you no indication, so naturally, you click Submit again. Still nothing. You decide to click a third time, just to be sure.

At this point, you are no longer submitting an application but conducting an experiment on how many times a button can be clicked before something interesting happens.

The problem

In our poor implementation, the submission button remains available while the mock request is pending. There is no clear loading indicator, no meaningful pending message, and no immediate feedback explaining the state of the operation.

The candidate cannot tell whether their application is being processed, whether the first click registered, or whether they should try again. This uncertainty encourages repeated submissions.

In a real application, depending on the backend and request handling, repeated submissions could create duplicate records or trigger other unintended side effects.

The issue is not simply that the button looks inactive. It is that the interface fails to communicate what is happening and gives the user no reason to trust that their action was received.

The improvement: Make the submission lifecycle visible

I introduced an explicit submission lifecycle in the improved version.

The interface communicates three important states:

  • Ready: The application is ready to be submitted.
  • Submitting: The request is being processed. The button is disabled, and its label communicates that something is happening.
  • Success: The application has been submitted successfully, with a confirmation message and mock reference.

The improved implementation also guards against repeated attempts while a submission is already in progress and provides an accessible status announcement so users relying on assistive technology can receive feedback about the submission state.

Now, after clicking Submit, the candidate does not have to guess. They know the request is being processed, and the interface prevents them from initiating another attempt while that process is underway.

GIF showing submission state implementation

The engineering lesson

A user action should produce meaningful feedback. This is particularly important for operations that take time, such as submitting applications, processing payments, uploading files, or saving information.

For every asynchronous operation, consider:

  • What does the user see immediately after initiating it?
  • Can they distinguish between a pending operation and an unresponsive interface?
  • Are repeated actions prevented when they should be?
  • How is success communicated?
  • What happens if the operation fails?

There is one important engineering distinction worth making here. Disabling a button and guarding against repeated clicks improves the frontend experience, but it does not guarantee that a backend operation will execute exactly once.

Networks fail. Requests can be retried. Responses can be lost after the server has already processed an operation. Production systems may need additional safeguards, such as idempotency mechanisms, to handle those situations reliably.

Our demonstration focuses on the user-facing problem and the frontend's responsibility to communicate and control the submission lifecycle.

If an operation takes time, tell the user. If another attempt could cause trouble, prevent it.

5. The mouse works. The keyboard doesn't.

Let's upload an attachment. You move your mouse over the upload area, click it, and the file picker opens. Everything works perfectly.

Try the same thing without a mouse. You press Tab, expecting the upload control to receive focus, but nothing happens.

The upload area looks interactive, behaves interactively when clicked, and even has a perfectly reasonable label. But your keyboard cannot reach it.

The problem

In our poor implementation, we created a custom upload target that responds to mouse clicks but is excluded from the keyboard tab order.

As a result, keyboard users cannot reach the control through normal navigation. This is a significant usability and accessibility problem. A candidate who relies on keyboard navigation may be unable to upload the very document required to complete the application.

The improvement: Use the platform's built-in capabilities

For the improved version, I went with a much simpler approach: a native, properly labelled file input.

Instead of recreating the behavior of a browser control, I let the browser provide the interaction it already knows how to handle.

The improved control includes:

  • A visible label associated with the file input.
  • Instructions explaining what the user should upload.
  • Accessible information about the selected file.
  • Native keyboard interaction and focus behavior.

This means users can reach and operate the control using the keyboard without needing a separate custom interaction model. It also preserves the familiar experience for mouse and touch users.

GIF showing keyboard accesibility implementation

The engineering lesson

Custom controls are not inherently bad. Sometimes a product genuinely needs an interaction that native HTML controls cannot provide. However, whenever we build one, we inherit the responsibility of implementing its interaction semantics correctly.

That includes keyboard support, focus management, accessible names, state communication, and predictable behavior.

Before reaching for a custom component, ask:

  • Does a native HTML element already provide this behavior?
  • Can the control be reached using Tab and Shift+Tab?
  • Can it be operated using the expected keyboard keys?
  • Is its purpose clear to assistive technology?
  • Is its state communicated to users who cannot rely on visual changes alone?

One of the most useful accessibility decisions an engineer can make is knowing when not to build a custom control. Native HTML elements come with a lot of carefully implemented behavior. We should take advantage of that instead of accidentally throwing it away.

If your upload button only works when someone points at it, you have not finished building yet.

6. I came back to finish, but the form had other plans.

You have filled in most of your application. Your personal details are complete. Your experience is written out. You have selected the role you are applying for.

Then something comes up. Maybe your internet connection drops. Maybe you simply need to step away and finish the application later.

You come back later only to find the form is empty.

The problem

In our poor implementation, form values exist only in the application's in-memory state. That works while the page remains active. But once the page is refreshed or the application is reloaded, those values disappear. The form has no mechanism for preserving progress between visits.

This is particularly frustrating for longer forms. Users may have spent several minutes providing information, writing detailed responses, and making selections. Losing all of that work creates unnecessary repetition and increases the likelihood that they will abandon the task altogether.

We should not assume that everyone can complete a form in one uninterrupted sitting.

The improvement: Save progress and make recovery possible

For the improved implementation, I introduced session-based draft persistence using the browser's sessionStorage. The form saves the candidate's progress and restores it when they return to the application within the same browser tab session.

This means:

  • Text fields and selections are restored after a page refresh.
  • The candidate can continue from where they left off.
  • A clear option allows them to discard their saved draft.
  • Discarding a draft also clears its stored data, so it does not unexpectedly reappear.

There is one deliberate limitation: the resume file itself is not saved. Browser file inputs have security restrictions. The interface communicates that the candidate will need to select the file again.

We also chose sessionStorage rather than treating this as permanent storage. The draft is scoped to the current tab session; it is not a promise that the candidate can return days later, switch devices, or recover their application indefinitely.

That distinction matters because persistence should match the experience we are promising.

GIF showing draft recovery implementation

The engineering lesson

Long forms should account for interruptions. A user might refresh the page accidentally, lose connectivity, close a tab, or simply decide to finish later. We should think about how much work they stand to lose and whether we can provide a reasonable recovery mechanism.

When designing draft persistence, consider:

  • What should be saved? Identify the fields that can safely and usefully be restored.
  • When should it be saved? Decide whether to save on every change, after a short delay, or at specific checkpoints.
  • How long should it be retained? Session storage, local storage, and server-side drafts offer different lifetimes and trade-offs.
  • How can users discard it? Users should have a clear way to remove a saved draft.
  • What should not be saved? Files and sensitive information may require different handling.

There is also a security consideration. Browser storage is accessible to JavaScript running on the same origin, so it should not become a convenient dumping ground for sensitive information. In a production application, the sensitivity of the data, shared-device risks, retention period, and user expectations should influence the persistence strategy.

Our example demonstrates a modest but useful improvement: a candidate can refresh the page without losing their text and selections, and they remain in control of discarding the draft.

The bigger principle is simple:

Do not make users repeat work that your application could reasonably preserve.

People have lives outside our forms. Sometimes they need to leave, find a document, answer a call, or just take a break. A good form should make it easier to come back and finish.

Before you ship that form, ask these questions.

After working through these six examples, one thing stands out. Most of the improvements did not require a completely new architecture, an expensive library, or a clever design system.

They required us to question a few assumptions. Does the dropdown really cover every legitimate answer? Does the validation rule serve the user's task, or just the developer's expectations? What happens when the network fails? Can someone tell whether their submission is being processed? Can they use the form without a mouse? Will their progress survive an interruption?

These are engineering decisions. And they deserve the same attention we give to API contracts, database constraints, and error handling.

Here is a practical checklist I would keep nearby when building or reviewing forms.

1. Can users provide accurate answers?

  • [ ] Are the available options representative of the answers users may actually have?
  • [ ] Is there a sensible alternative when a predefined option does not fit?
  • [ ] Do validation rules accept legitimate input, including names and characters we may be unfamiliar with?
  • [ ] Are restrictions driven by genuine business or technical requirements?

2. Does the form help users recover from errors?

  • [ ] Are error messages specific enough to explain what happened?
  • [ ] Do users know what they need to do next?
  • [ ] Is previously entered information preserved when submission fails?
  • [ ] Can users distinguish a confirmed failure from an unknown submission outcome?

3. Is the submission process understandable?

  • [ ] Does the interface immediately acknowledge a submission attempt?
  • [ ] Is a pending state clearly communicated?
  • [ ] Are repeated submissions prevented where appropriate?
  • [ ] Is success communicated clearly?
  • [ ] Does the backend have appropriate safeguards against duplicate processing where necessary?

4. Can everyone operate the form?

  • [ ] Can users navigate every control with a keyboard?
  • [ ] Are controls labelled correctly?
  • [ ] Is focus visible and managed sensibly?
  • [ ] Are status updates and errors available to assistive technologies?
  • [ ] Have we considered whether native HTML elements could provide the required behavior without unnecessary custom implementation?

5. Does the form respect the user's time?

  • [ ] Is progress preserved when users are likely to need more than one sitting?
  • [ ] Is the persistence strategy appropriate for the sensitivity of the information?
  • [ ] Can users intentionally discard saved progress?
  • [ ] Are there clear expectations about what is and is not saved?

6. Have we tested the experience, not just the happy path?

  • [ ] Have we tested missing, unusual, and legitimate-but-unexpected input?
  • [ ] Have we tested failed and delayed submissions?
  • [ ] Have we checked what happens after a refresh or interruption?
  • [ ] Have we tested keyboard navigation rather than assuming it works?
  • [ ] Have we checked the experience at different viewport sizes?
  • [ ] Have we tested with automated accessibility checks and, where possible, real assistive technology?

You do not need to treat this as a release gate that every form must satisfy in exactly the same way. Context matters. A short newsletter subscription form and a multi-page financial application have different risks and requirements.

But the questions are worth asking.

A note on Angular and React

Having demonstrations in both Angular and React was intentional.

The implementation details differ, of course. Angular and React have different approaches to components, state, forms, and application structure. However, the underlying decisions remained the same: preserve user input, communicate state, validate responsibly, provide accessible interactions, and make recovery possible.

Good form UX is not a framework feature. It is an engineering responsibility.

A simple way to review your next form

When reviewing a form, I find it useful to walk through the experience in the same order a user would encounter it.

A practical review flow for evaluating form UX before release.

Figure: A practical review flow for evaluating form UX before release.

The form worked. But did it help?

We started with a simple observation. A form can be technically functional and still frustrate the person using it.

After six demonstrations, I think that distinction is worth taking seriously.

A dropdown can validate successfully while excluding legitimate answers. A name field can enforce its regex while rejecting real names. A submission handler can catch an error while destroying the user's work. A button can trigger an API request while leaving someone wondering whether anything happened. A form can look perfectly interactive while being completely inaccessible to someone navigating with a keyboard.

None of these problems necessarily comes from a developer who does not know how to write code. In many cases, they come from decisions that seemed reasonable when viewed only from the implementation side.

That is why form UX deserves more than a final styling pass before release. It should influence how we think about requirements, data validation, error handling, accessibility, state management, and testing from the beginning.

Building the same examples in Angular and React also reinforced something important for me. The principles do not belong to a particular framework. They belong to the craft of building software that people can actually use.

And perhaps that is the question we should ask more often when reviewing our work:

Does this form merely accept input, or does it genuinely help someone complete their task?

Passing validation is great. Meeting the user's expectations is even better.

The form worked, but let's make sure the next one works for the user, too.

Explore the implementations: Form UX Study

原文:https://www.a8q9.cn/en/article/the-form-worked-the-user-still-left-0f63ac.html

相关文章