views:

162

answers:

7

It's quite common to have a form with a checkbox stating "Use foo" immediately followed by a textbox where the user can input the "foo value" he want's to use. Of course, this textbox is useful only if "Use foo" is checked

I don't know the best way to deal with this situation :

  1. Disable the textbox (ie textboxfoo.Enabled=false;)
  2. Hide it (ie textboxfoo.Visible=false;)
  3. Let the user input a foo value if he wants to, and ignore the value he entered.

Is there a best practice that I can follow ?

+11  A: 

The textbox should be disabled.

If the textbox is hidden, then the visible alteration of the form will make the program less user-friendly. An example of this is the old (very unpopular) disappearing menu items that used to be in Microsoft Office. People don't want things moving around on their screens. It's disorienting.

If the user is permitted to input a useless value, then that gives the false impression that entering the value has some effect.

Jeffrey L Whitledge
+1 (except I'm out of votes, I guess I'll have to "come back tomorrow")
Rob
In addition, I think you can change a tooltip setting to display even if the control is disabled. So you could have the tooltip explain why the control is disabled, and/or how to re-enable it.
Kyralessa
A: 

I favour disabling over hiding, if only because it avoids unnecessary white space on your dialog.

Stu Mackellar
+1  A: 

Disable the textbox

With the textbox hidden the user may skip over the option "Use Foo" since it won't be clear to them how they will or should define "foo". With the textbox visible but disabled the user will recognize that they can define "foo" once they say they want to use it.

ShaneB
+2  A: 

Disabling the text box is the best option in this case. The fact that the text box is enabled/disabled as the checkbox is checked/unchecked provides useful feedback to the user: the use foo option expects a foo value, and the foo value is only meaningful if the use foo option is selected.

Hiding the text box is less satisfactory - if the box isn't checked, the user won't realize that enabling the foo option will allow them to specify the foo value. Imagine them thinking to themselves: "I'd better not select the use foo option, as I have no idea what foo value will be used."

The third option is the worst, since doesn't indicate that the entered value will be ignored.

Stephen C. Steel
Also, a default value visible in the disabled text box can provide additional information about exactly what is meant by "Foo" (e.g., a foo _number_). Much more at http://www.zuschlogin.com/?p=40.
Michael Zuschlag
A: 

Disable the text box.
It makes it clear to user that there is an option that happens to be unavailable. Hiding it will sometimes get a user response of "Where did my box go".

C. Ross
+1  A: 

Clearly disabling the text box is favoured because the user still has a visual clue as to what "Foo" will enable them to do.

But about what about the "More options >>" / "<< Less options" panel that opens up or closes as "Foo" is checked/uncheck? To much work, from the developer's perspective, and/or too much fiddling, from the user's perspective? Myself, I like the way it cleans up the interface, given that the defaults for "Foo" (when hidden) are appropriate.

(Having said that, I don't use that everywhere. Moderation in all good things.)

JMD
A: 

Another option would be to let the enter input some data if he wants too, but to auto-check the foo checkbox if he starts typing into the foo textbox.

Brann