please dont rip this site

JavaScript: The Definitive Guide

Previous Chapter 21
JavaScript Reference
Next
 

Textarea Element

Name

Textarea Element---a multiline text input area

Availability

Navigator 2.0, Internet Explorer 3.0; enhanced in Navigator 3.0

Synopsis

form.name
form.elements[i]

Properties

defaultValue

A read-only string that specifies the initial value to appear in the input field. This default value is whatever plain text appears between the <TEXTAREA> and </TEXTAREA> tags.

form

A read-only reference to the Form object that contains the Textarea element.

name

A read-only string, set by the HTML NAME attribute, that specifies the name of the Textarea element. This is also the name that can be used to reference the Textarea element as a property of its form.

type

A read-only string that specifies the type of this form element. For Textarea elements, it has the value "textarea." Available in Navigator 3.0 and later.

value

A read/write string that specifies the value contained in the Textarea (which is also the value sent to the server when the form is submitted). The initial value of this property is the same as the defaultValue property.

Methods

blur()

Remove the keyboard focus from the Textarea element.

focus()

Set the keyboard focus to the Textarea element. When focus is set, all keystrokes are automatically entered into this element.

select()

Highlight all the text in the Textarea element, and enter a special mode so that future input replaces the highlighted text.

Event Handlers

onblur()

Invoked when a user action causes the Textarea element to lose the keyboard focus.

onchange()

Invoked when the user changes the value in the Textarea element and moves the keyboard focus elsewhere. This event handler is not invoked for every keystroke in the Textarea element, but only when the user completes an edit.

onfocus()

Invoked when a user action causes the Textarea element to gain the keyboard focus.

HTML Syntax

A Textarea element is created with standard HTML <TEXTAREA> and </TEXTAREA> tags, with the addition of optional attributes for event-handlers:

<FORM>
    ...
  <TEXTAREA
    [ NAME="name" ]   a name that can later be used to refer to this element
    [ ROWS=integer ]  how many lines tall the element is
    [ COLS=integer ]  how many characters wide the element is
    [ WRAP=off|virtual|physical ]   how word wrapping is handled
    [ onBlur="handler" ]  the onblur() event handler
    [ onChange="handler" ]    the onchange() event handler
    [ onFocus="handler" ] the onfocus() event handler
  >
    plain_text    the initial text; specifies defaultValue 
  </TEXTAREA>
    ...
</FORM>

Description

The Textarea element represents a text input field in a form. The NAME attribute specifies a name for the element. This is mandatory if the form is to be submitted, and also provides a convenient way to refer to the Textarea element from JavaScript code. The COLS attribute specifies the width, in characters, of the element as it appears on the screen, and the ROWS attribute specifies the height, in lines of text, of the element. The WRAP attribute specifies how long lines should be handled: the value off specifies that they should be left as is; the value virtual specifies that they should be displayed with line breaks but transmitted without; and the value physical specifies that they should be displayed and transmitted with line breaks inserted.

Besides these HTML attributes, value is the main property of interest for the Textarea element. You can read this property to obtain the user's input, or you can set it to display arbitrary (unformatted) text in the Textarea. The initial value of the value property (and the permanent value of the defaultValue property) is the text that appears between the <TEXTAREA> and </TEXTAREA> tags.

Usage

If you need only a single line of input text, use the Text element. If the text to be input is sensitive information, such as a password, use the Password element.

See Also

"Element", "Form", "Password", "Text"


Previous Home Next
Text.value Book Index Textarea.blur()

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell

file: /Techref/language/JAVA/SCRIPT/definitive/refp_402.htm, 10KB, , updated: 2019/10/14 15:00, local time: 2024/12/24 09:28,
TOP NEW HELP FIND: 
18.219.158.84:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://massmind.ecomorder.com/Techref/language/JAVA/SCRIPT/definitive/refp_402.htm"> [Chapter 21] Reference: Textarea</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to ecomorder.com!

 

Welcome to massmind.ecomorder.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .