Text box
Encyclopedia
A text box, text field or text entry box is a kind of widget
used when building a graphical user interface
(GUI
). A text box's purpose is to allow the user to input text information to be used by the program. User-interface guidelines
recommend a single-line text box when only one line of input is required, and a multi-line text box only if more than one line of input may be required. Non-editable text boxes can serve the purpose of simply displaying text.
A typical text box is a rectangle of any size, possibly with a border that separates the text box from the rest of the interface. Text boxes may contain zero, one, or two scrollbar
s. Text boxes usually display a text cursor (commonly a blinking vertical line), indicating the current region of text being edited. It is common for the mouse cursor
to change its shape when it hovers over a text box.
The keys indicated relate to the text box widget in Microsoft Windows and Mac OS X; similar if not identical keyboard bindings exist under the X Window System
and other systems, and typically follow the same scheme as Windows.
Widget (computing)
In computer programming, a widget is an element of a graphical user interface that displays an information arrangement changeable by the user, such as a window or a text box. The defining characteristic of a widget is to provide a single interaction point for the direct manipulation of a given...
used when building a graphical user interface
Graphical user interface
In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...
(GUI
Gui
Gui or guee is a generic term to refer to grilled dishes in Korean cuisine. These most commonly have meat or fish as their primary ingredient, but may in some cases also comprise grilled vegetables or other vegetarian ingredients. The term derives from the verb, "gupda" in Korean, which literally...
). A text box's purpose is to allow the user to input text information to be used by the program. User-interface guidelines
Human Interface Guidelines
Human interface guidelines are software development documents which offer application developers a set of recommendations. Their aim is to improve the experience for the users by making application interfaces more intuitive, learnable, and consistent. Most guides limit themselves to defining a...
recommend a single-line text box when only one line of input is required, and a multi-line text box only if more than one line of input may be required. Non-editable text boxes can serve the purpose of simply displaying text.
A typical text box is a rectangle of any size, possibly with a border that separates the text box from the rest of the interface. Text boxes may contain zero, one, or two scrollbar
Scrollbar
A scrollbar is an object in a graphical user interface with which continuous text, pictures or anything else can be scrolled including time in video applications, i.e., viewed even if it does not fit into the space in a computer display, window, or viewport...
s. Text boxes usually display a text cursor (commonly a blinking vertical line), indicating the current region of text being edited. It is common for the mouse cursor
Cursor (computers)
In computing, a cursor is an indicator used to show the position on a computer monitor or other display device that will respond to input from a text input or pointing device. The flashing text cursor may be referred to as a caret in some cases...
to change its shape when it hovers over a text box.
Standard functionality
Typical implementations allow a user to do the following:- Type in text using a keyboard
- When keys are pressed, the text appears where the caretCaretCaret usually refers to the spacing symbol ^ in ASCII and other character sets. In Unicode, however, the corresponding character is , whereas the Unicode character named caret is actually a similar but lowered symbol: ....
is. Some very simple text boxes may not show a caret, which would suggest that new characters typed in will appear at the end of the current text.
- When keys are pressed, the text appears where the caret
- Navigate and select portions of text
- Using a mouse:
- Change the caret position by clicking the desired point with a mouse cursor;
- Select a portion of text by pressing the main mouse button while pointing the cursor at one end of the desired part of the text and dragging the cursor to the other end while holding the button pressed.
- Using the keyboard:
- Pressing arrowArrow keysCursor movement keys or arrow keys are buttons on a computer keyboard that are either programmed or designated to move the cursor in a specified direction....
keys changes caret position by one character or line (in multiline text boxes); - Pressing Home/End keys (Microsoft's Windows OSMicrosoft WindowsMicrosoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
) or CommandCommand keyThe Command key, also historically known as the Apple key, open-Apple key or meta key is a modifier key present on Apple Keyboards. The Command key's purpose is to allow the user to enter keyboard shortcut commands to GUI applications...
-left arrow/Command-right arrow (Apple's Mac OSMac OSMac OS is a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...
) moves the caret to the beginning/end of the line; - Pressing Page Up/Down moves the caret a page (the number of lines that can be displayed in the text box at a time) backward/forward (Windows) or moves the scrollbarScrollbarA scrollbar is an object in a graphical user interface with which continuous text, pictures or anything else can be scrolled including time in video applications, i.e., viewed even if it does not fit into the space in a computer display, window, or viewport...
thumb a page backward/forward without changing the caret position (Mac OS); - Holding the CtrlControl keyIn computing, a Control key is a modifier key which, when pressed in conjunction with another key, will perform a special operation ; similar to the Shift key, the Control key rarely performs any function when pressed by itself...
key (Windows) while pressing arrow keys or Home/End keys makes the caret move at larger steps - e.g. words or paragraphs or beginning/end of document; - Holding the Option keyOption keyThe Option key is a modifier key present on Apple keyboards. It is located between the Control key and Command key on a typical Mac keyboard. There are two option keys on modern Mac desktop and notebook keyboards, one on each side of the space bar....
(Mac OS) while pressing arrows moves the caret whole words or paragraphs; - Holding the Command keyCommand keyThe Command key, also historically known as the Apple key, open-Apple key or meta key is a modifier key present on Apple Keyboards. The Command key's purpose is to allow the user to enter keyboard shortcut commands to GUI applications...
while pressing up or down arrows (Mac OS) or Holding the Ctrl key while pressing home/end (Windows) moves the caret to the beginning or end of the document; - Holding the shiftShift keyThe shift key is a modifier key on a keyboard, used to type capital letters and other alternate "upper" characters. There are typically two shift keys, on the left and right sides of the row below the home row...
key while changing the caret position with a mouse or keyboard selects the text between the caret position from when shift was first pressed and its current position.
- Pressing arrow
- Using a mouse:
- Edit the text (enable changing the text already entered)
- Work in insert or overwrite mode, typically switched using Insert keyInsert keyThe Insert key is a key commonly found on computer keyboards.It is primarily used to switch between the two text-entering modes on a personal computer or word processor. The first is overtype mode, in which the cursor, when typing, overwrites any text that is present on and after its current...
. In insert mode if there is a character to the right of the caret, the new character will be inserted before it, while in overwrite mode typing a new character will replace (overwrite) the character to the right of the caret position. - Typing in a text while some part of the text already entered is selected will replace the selected text.
- DeleteDelete keyThe delete key , known less ambiguously as forward delete, performs a function when struck on a computer keyboard during text or command editing, which is to discard the character ahead of the cursor's position, moving all following characters one position "back" towards the freed letterspace. The...
/BackspaceBackspaceBackspace is the keyboard key that originally pushed the typewriter carriage one position backwards, and in modern computer displays moves the cursor one position backwards, deletes the preceding character, and shifts back the text after it by one position....
keys remove one character right/left of current caret position, while pressing them together with the Ctrl or command key removes one word. - Edit the text using standard clipboardClipboard (software)The clipboard is a software facility that can be used for short-term data storage and/or data transfer between documents or applications, via copy and paste operations...
operations.
- Work in insert or overwrite mode, typically switched using Insert key
- UndoUndoUndo is a command in many computer programs. It erases the last change done to the document reverting it to an older state. In some more advanced programs such as graphic processing, undo will negate the last command done to the file being edited....
/Redo changes with Ctrl+ZControl-ZIn computing, is a control character in ASCII code, also known as the substitute character or a keyboard shortcut. Strictly speaking, is not a printable character at all but a code for control purposes, though it is sometimes rendered by two characters as ^Z. It is generated by pressing the key...
/Ctrl+YControl-YFor some Microsoft Windows computer applications, the key combination will redo a previous action that the user chose to undo. usually does not have this meaning in the Apple Macintosh operating system, where often does it....
(Windows) or command-Z/command-shift-Z (Mac OS)
The keys indicated relate to the text box widget in Microsoft Windows and Mac OS X; similar if not identical keyboard bindings exist under the X Window System
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...
and other systems, and typically follow the same scheme as Windows.