
The text input field is an element ( widget ) of the graphical user interface designed to enter a small amount of text without line breaks. It looks like a small rectangle filled with a background color (usually white), and when the input focus is received, a cursor appears, inviting you to enter text into the field.
Content
Basic Functions
Typically, text input fields provide all the basic operating system capabilities for working with text, including selecting, correcting, working with the clipboard, dragging text fragments, etc. These features are provided through mouse gestures, keyboard shortcuts and context menu . Pressing the ↵ Enter key is usually not processed in any way by the input field, or it confirms the entered value and performs an action (for example, searching for files).
Advanced Features
Since text input fields are used very widely, additional functions are often tied to them. The most common extensions: validation of input, prompts for input and organization of data already entered.
Input Validation
In order that the user could not enter a value that is not allowed by the logic of the program, various techniques are used:
- ignoring invalid characters - for example, when you try to enter a letter in the field for entering numbers;
- resetting the value already entered - for example, if you enter an invalid day of the month in the date field;
- selection of incorrectly filled fields, or individual characters - for example, underlining, color change;
- tooltips indicating that the data was entered incorrectly and explaining which characters are allowed to be entered and which are not. This method can be combined with other methods.
Validation of the entered data can be performed during the input process, but if the verification involves a significant expenditure of resources (for example, requires a query to the database), the verification is performed when leaving the field, or when trying to confirm the entered data. Also, input validation can be launched during pauses during input - spelling checkers often do this.
Input Tips
It is common practice that several similar values entered before, such as web addresses, are displayed under the input field. This behavior makes it look like a combo box . In contrast, the input prompt field displays only the most appropriate values. In addition, only a limited number of lines are displayed — enough to display without a scrollbar .
Literature
- Alan Cooper. about the interface. Design Basics = About Face. The Essentials of Interaction Design. - 3. - SPb: Symbol Plus, 2009. - p. 520-527. - 688 s. - 1500 copies - ISBN 978 5 93286 132 5 .
- OS X Human Interface Guidelines: Text Input Field .