AusDTO / gov-au-ui-kit

MOVED TO https://github.com/govau/uikit/
https://github.com/govau/uikit/
MIT License
19 stars 12 forks source link

Is there a design guideline for "optional" form field? #389

Closed elisechant closed 7 years ago

elisechant commented 8 years ago

What I did

Creating optional form elements. Following the documentation that says:

If you have to ask for optional information mark the field labels with ‘(optional)’.

Should I render "optional" like:

<label>Name (optional)</label>

or is there a recommended design pattern to do this?

What comes to mind is:

<label>Name <sup>(optional)</sup></label>

klepas commented 7 years ago

Sorry to get back to this so late @elisechant

Semantically I would not use superscript, but a span instead, and control the styling via vertical-align, and adjusting it’s font size the same way.

If you do lower the font size don’t go under 14px.

Few egs from a quick play:

screen shot 2017-01-10 at 3 39 03 pm

screen shot 2017-01-10 at 3 38 04 pm

If there’s value in this I’d be glad to add these to the forms module for 2.x. Thoughts?

klepas commented 7 years ago

cc @lreichelt

lreichelt commented 7 years ago

conscious that it is incredibly annoying to do this when you've just closed the issue... I'm wondering, what is the user need for an optional field? I'd prefer our guidance to government was to not have optional fields. Why are we asking for information if we don't absolutely need it?

klepas commented 7 years ago

@lreichelt—

I'd prefer our guidance to government was to not have optional fields. Why are we asking for information if we don't absolutely need it?

Generally agree, and is similar to our current guidance on the subject.

We’ve been asked how to denote optional fields in the past. Our advice is to not ask that question then at all, and if you absolutely must:

If you have to ask for optional information mark the field labels with ‘(optional)’.