
This interface specifies a multiline text input control.
The default font is fixed pitch.
IHTMLTextAreaElement Methods
HRESULT createTextRange(
IHTMLTxtRange **range
);
Creates a text range object for the element. You use a text range to examine and modify the text within the element.
See also IHTMLTxtRange
HRESULT get_cols(
long *p
);
Retrieves the width, in columns (characters), of a TEXTAREA control.
See also put_cols
HRESULT get_defaultValue(
BSTR *p
);
Retrieves the default value of the TEXTAREA element.
This value can be changed programmatically but has no effect on the appearance nor on how forms are submitted.
See also put_defaultValue
HRESULT get_disabled(
VARIANT_BOOL *p
);
Determines whether the control is enabled or disabled.
The default value for this property is FALSE.
See also put_disabled
HRESULT get_form(
IHTMLFormElement **p
);
Retrieves a reference to the form the element is embedded on.
See also IHTMLFormElement
HRESULT get_name(
BSTR *p
);
Retrieves the name of the TEXTAREA element.
The name is used to bind the value of the control when submitting a form. The name is not the value that is displayed in the entry field of the element. Submitting the form submits the internally stored value, not the one displayed.
JScript allows the name to be changed at run time. This does not change the name in the programming model, in the collection of elements, but does change the name used for submitting elements.
See also put_name
HRESULT get_onchange(
VARIANT *p
);
Retrieves the inline script associated with the onchange event for the TEXTAREA element. The onchange event occurs when the contents of the object have changed.
For more information on inline script, see Attaching an Event Handler in the Event Model documentation.
See also put_onchange
HRESULT get_onselect(
VARIANT *p
);
Retrieves the inline script associated with the onselect event for the TEXTAREA element. The onselect event fires at the beginning of a user-initiated select. This event can be canceled, and it participates in the bubbling model.
For more information on inline script, see Attaching an Event Handler in the Event Model documentation.
See also put_onselect
HRESULT get_readOnly(
VARIANT_BOOL *p
);
Determines whether the element's contents are read-only, meaning that the user cannot enter or edit text in the control.
This is different than disabled. Read-only still allows the element to receive the focus, while disabled does not allow the element to receive the focus.
The default value for this property is FALSE.
See also put_readOnly
HRESULT get_rows(
long *p
);
Retrieves the height, in rows, of the TEXTAREA control.
See also put_rows
HRESULT get_status(
VARIANT *p
);
Retrieves the status of the TEXTAREA element.
See also put_status
HRESULT get_type(
BSTR *p
);
Retrieves the type of intrinsic control represented by the given element object.
| Element | Possible value | Description |
| INPUT | checkbox | Used for simple Boolean attributes or for attributes that can take multiple values at the same time. It is represented by a number of check box fields, each of which has the same name. Each selected check box generates a separate name/value pair in the submitted data, even if this results in duplicate names. The default value for check boxes is on. |
| file | A file upload element. | |
| hidden | No field is presented to the user, but the content of the field is sent with the submitted form. This value can be used to transmit state information about client/server interaction. | |
| image | An image field that you can click, causing the form to be immediately submitted. The coordinates of the selected point are measured in pixel units from the upper-left corner of the image, and are returned (along with the other contents of the form) in two name/value pairs. The x-coordinate is submitted under the name of the field with .x appended, and the y-coordinate is submitted under the name of the field with .y appended. Any value property is ignored. The image itself is specified by the SRC attribute, exactly as for the Image element. | |
| password | Same as the TEXT attribute, except that text is not displayed as the user enters it. | |
| radio | Used for attributes that accept a single value from a set of alternatives. Each radio-button field in the group should be given the same name. Only the selected radio button in the group generates a name/value pair in the submitted data. Radio buttons require an explicit value property. | |
| reset | reset is a button that when clicked resets the form's fields to their specified initial values. The label to be displayed on the button can be specified just as for the submit button. | |
| submit | submit is a button that when clicked submits the form. You can use the value attribute to provide a non-editable label to be displayed on the button. The default label is application-specific. If a submit button is clicked to submit the form, and that button has a name attribute specified, that button contributes a name/value pair to the submitted data. Otherwise, a submit button makes no contribution to the submitted data. | |
| text | Used for a single-line text-entry field. Use in conjunction with the size and maxLength properties. | |
| SELECT | select-multiple | Specifies a multiple-select list box. |
| select-one | Specifies a single-select list box. | |
| TEXTAREA | textarea | Used for multiple-line text-entry fields. Use in conjunction with the size and maxLength properties. |
HRESULT get_value(
BSTR *p
);
Retrieves the current text from the entry field of the TEXTAREA element.
See also put_value
HRESULT get_wrap(
BSTR *p
);
Retrieves how word-wrapping is handled in the element.
| off | Word-wrapping is disabled. The lines appear exactly as the user types them. This is the default value for this property. |
| physical | The text is displayed and submitted word-wrapped. |
| virtual | The text is displayed word-wrapped but is submitted as typed. |
See also put_wrap
HRESULT put_cols(
long v
);
Sets the width, in columns (characters), of the TEXTAREA control.
See also get_cols
HRESULT put_defaultValue(
BSTR v
);
Sets the default value of the TEXTAREA element.
This value can be changed programmatically but has no effect on the appearance nor on how forms are submitted.
See also get_defaultValue
HRESULT put_disabled(
VARIANT_BOOL v
);
Enables or disables the control. A disabled control appears dimmed and does not respond to user input.
The default value for this property is FALSE.
See also get_disabled
HRESULT put_name(
BSTR v
);
Sets the name of the TEXTAREA element.
The name is used to bind the value of the element when submitting a form. The name is not the value that is displayed in the entry field of the element. Submitting the form submits the internally stored value, not the one displayed.
JScript allows the name to be changed at run time. This does not change the name in the programming model, in the collection of elements, but does change the name used for submitting elements.
See also get_name
HRESULT put_onchange(
VARIANT v
);
Sets the inline script associated with the onchange event for the TEXTAREA element. The onchange event occurs when the contents of the object have changed.
For more information on inline script, see Attaching an Event Handler in the Event Model documentation.
See also get_onchange
HRESULT put_onselect(
VARIANT v
);
Sets the inline script associated with the onselect event for the TEXTAREA element. The onselect event fires at the beginning of a user-initiated select. This event can be canceled, and it participates in the bubbling model.
For more information on inline script, see Attaching an Event Handler in the Event Model documentation.
See also get_onselect
HRESULT put_readOnly(
VARIANT_BOOL v
);
Specifies whether the element's contents are read-only, meaning that the user cannot enter or edit text in the control.
This is different than disabled. Read-only still allows the element to receive the focus, while disabled does not allow the element to receive the focus.
The default value for this property is FALSE.
See also get_readOnly
HRESULT put_rows(
long v
);
Sets the height, in rows, of the TEXTAREA control.
See also get_rows
HRESULT put_status(
VARIANT v
);
Sets the status of the TEXTAREA element.
See also get_status
HRESULT put_value(
BSTR v
);
Sets the text entry field of the TEXTAREA element, replacing any existing text.
See also get_value
HRESULT put_wrap(
BSTR v
);
Specifies how to handle word-wrapping in the element.
| off | Word-wrapping is disabled. The lines appear exactly as the user types them. This is the default value for this property. |
| physical | The text is displayed and submitted word-wrapped. |
| virtual | The text is displayed word-wrapped but is submitted as typed. |
See also get_wrap
HRESULT select(
void
);
Highlights the input area of a form element.
You can use the select method with the focus method to highlight a field and position the cursor for a user response.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.