WebAIM - Web Accessibility In Mind

E-mail List Archives

HTML Forms with required inputs and a save draft feature

for

From: connrs
Date: Mar 17, 2025 7:07AM


Hi all,

I'm looking for advice about HTML forms containing inputs that are required
(i.e. they have the required attribute set) but where there may be a need
to allow for a 'save for later' (or similar) feature.

In the simple scenario, the user would click the submit button and either
the browser would flag up the mandatory fields using native form validation
APIs or custom client-side validation would do the same thing.

However, a more complicated scenario would be where all but a handful of
inputs could optionally be left blank or untouched because the user could
choose to 'save for later' because they don't have all the data to hand but
want to partially save their progress.

Where I've been involved in the development of forms like this in the past
the teams have:

1. Put clear language at the top of the form to explain that all fields
listed as required will be required but that they may be left blank as long
as the user isn't publishing (1) and is merely saving for later.
2. Set the required attribute on all required inputs regardless of whether
they are optional until the publish action
3. Include the word "mandatory" or "required" in the label of all inputs
regardless of whether they are optional until the publish action

Is this appropriate or not quite right? Are there any other accepted
patterns/techniques for this?

Kind regards,
Paul.

(1): I'm using the term publishing here as an example but this phrase could
be replaced with "fire the missiles", "submit my application", or "pay for
hotel booking".
--
*connrs (Paul Connolley)*
(he/him)
@ <EMAIL REMOVED> <https://indieweb.social/@connrs> - https://conn.rs/