Why this wireframe works | Form modal
Sign up without leaving the page
A short form is taken inside the modal, so readers can sign up without leaving the page they are reading.
Focus moves to the first field on opening
The first field is focused as soon as the modal opens, so typing can begin at once.
Errors and completion conveyed inside the modal
Missing fields are shown in words right under the field, and focus moves to the first error. After sending, the same modal confirms the request was received.
The backdrop does not close it
Closing by touching the backdrop mid-entry would wipe what was typed. In this pattern the backdrop does not close the modal; only the close button and Esc do.
Common mistakes | Form modal
Input lost by a click on the backdrop
If touching the backdrop mid-entry closes the modal and wipes what was typed, readers give up. A modal with a form should not close on the backdrop.
So many fields the modal keeps scrolling
With five or six fields, readers hunt for fields inside the modal. With many fields, use a contact page.
Closing after sending without a word
If the modal closes the instant the form is sent, readers cannot tell whether it went through. Say it was received and what happens next before closing.
Errors shown by color alone
A red border alone does not reach everyone. Write the error in words and link it to the field with aria-invalid and aria-describedby.
Stacking a discard confirmation on top of the modal
When someone tries to close a form mid-entry, switch to a confirmation view inside the original modal, or close it and open a separate confirmation. Do not make a modal on top of a modal the standard approach.
FAQ | Form modal
Should closing mid-entry ask for confirmation?
If nothing has been typed yet, closing with Esc or the close button is fine. If closing mid-entry would lose the input, consider asking “Discard what you entered?” or keeping the input when the modal closes.
Form modal or contact page?
For sign-ups of two or three fields, a modal; for a message to write or many fields, a page suits better.
Can the modal close automatically after sending?
Closing before readers can read the confirmation leaves them unsure whether it was sent. Show the completion message and let them close it with the button.
Does autofill work in a form inside a modal?
Yes. Add autocomplete values to fields like name and email, and people can fill them from the browser’s suggestions. With so few fields in this pattern, autofill makes a big difference to how much typing is needed.













