text

< html‎ | elements‎ | input‎ | type
Jump to: navigation, search

text

This article is Not Ready.



Summary

The input element with a type attribute whose value is "text" represents a one-line plain text edit control for the input element’s value.


Overview Table

DOM Interface HTMLInputElement

Examples

This example uses the INPUT type=text element to create an empty text control that can contain 15 characters without requiring the user to scroll to read all of the text.

<INPUT TYPE=text VALUE="" NAME="textbox" SIZE=15>

This example uses script to detect the content of the text box and display it in a dialog box.

<SCRIPT>
function detectEntry()
{
    alert("Your name is " + textbox.value)
}
</SCRIPT>

Notes

Remarks

The SIZE attribute sets the number of visible characters in the INPUT type=text element. The MAXLENGTH attribute sets the maximum number of characters that can be entered. Security Warning:  Using this object incorrectly can compromise the security of your application. When submitting text through INPUT type=text over an intranet or the Internet, validating the text string is recommended. For instance, you might validate the string for a restricted set of known, good values (such as letters and numbers) and ignore the rest. You should review the Security Considerations: Dynamic HTML before continuing. Note  For more code samples, see Form controls part 1 and Form controls part 2: validation on the Windows Internet Explorer sample site.

Standards information


HTML information

{

Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? ? ? ? ?

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic support ? ? ? ? ? ? ? ?

See also

External resources

http://www.w3.org/TR/html-markup/input.text.html#input.text

Related pages (MSDN)

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]