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 :
Is there a best practice that I can follow ?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With