3

For example when asking a user what pet they have and it's a required field, a Please select option is included since the pet is currently unknown:

<select required>
  <option value="">Please select</option>
  <option value="dog">Dog</option>
  <option value="cat">Cat</option>
  <option value="hamster">Hamster</option>
</select>

However if we already know the pet since it's been saved previously, and we only want to allow the user to change the required field, when the user returns to the page should we still include the Please select option?

So in this case, is it better to remove Please select so they cannot deselect the field:

<select required>
  <option value="dog">Dog</option>
  <option value="cat" selected>Cat</option>
  <option value="hamster">Hamster</option>
</select>

Or keep the Please select so the dropdown behaves the same as the original one they used to set the value. If they do deselect the field the browser will prompt them to provide an option when the form is submitted.

<select required>
  <option value="">Please select</option>
  <option value="dog">Dog</option>
  <option value="cat" selected>Cat</option>
  <option value="hamster">Hamster</option>
</select>

i.e. is it suitable to remove this option on a required <select> in this way when an option is saved?

3
3

As you have suggested, I would recommend in the instance of a required field, that you don't have the "please select" option when the user is "editing" the form.

If this is a required field, then the "please select" option is never valid during an edit, and therefore should not be included as it implies that the user can select it as a valid option.

Obviously it is important to keep it when the user first completes the form, as we do not want to assume a default that may be incorrect. This way we force the user to think about it and ensure they select the correct option. This helps improve the accuracy of the collected data.

For completeness, if the field was optional, then the list should include an option such as "None" or "Not Applicable". This way they still have to explicitly think about providing correct data, rather than just skipping over it and allowing a default blank option.

6
  • Thanks, this was my thinking also. It just seems slightly strange to change the options of required <select> fields based on whether the value has previously been set. This is not a pattern I'm familiar with, I think people typically always show the same <select> HTML regardless. – AlecRust Apr 30 at 13:02
  • The subtle difference between the behaviour is also something I wouldn't expect users to appreciate, but they may get used to how it works one way and expect that next time. Not a big problem, but potentially noticeable to the user. – AlecRust Apr 30 at 13:05
  • 1
    @AlecRust: Personally, I think that sounds like people who just can't be bothered to implement the scenarios differently, or perhaps just never considered it in the first place. It really doesn't make any sense to show that option during an edit. – musefan Apr 30 at 13:05
  • @AlecRust: Although I may be wrong, I wouldn't think a user will particularly notice (or care) that some sites allow them to select an invalid value during edit, and some don't. If anything, they will wonder "Why are you allowing me to select this value if you won't even let me confirm it?". How common a use case do you think it is for somebody to edit a form for the purpose of deselecting a required value? Not very often I would expect, and as long as it is clear that the field required then the user should not suffer any confusion as to why it isn't available. – musefan Apr 30 at 13:09
  • My point was not so much about different sites, but the same input on one site. A form may redirect back to the form after save, at which point the <select> has changed. But yes, I agree most users would not really notice. – AlecRust Apr 30 at 13:12
1

If this is the second time the user is proposed the same required option selection, do NOT use the empty <option value="">- - Please select - -</option> technique.

But more than that, the principle of proposing a second time to choose AGAIN from the same list of options could be a sign that your flow might need optimization.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.