Freigeben über


IHTMLFormElement interface

This interface specifies that the contained controls take part in a form.

Members

The IHTMLFormElement interface inherits from the IDispatch interface. IHTMLFormElement also has these types of members:

  • Methods
  • Properties

Methods

The IHTMLFormElement interface has these methods.

Method Description
appendItemSeparator

Allows element behaviors to append the item separator to the data sent to the server.

appendNameValuePair

Appends a name-value pair to the data submitted to the server.

item

Retrieves a form object or an object from an elements collection.

reset

Simulates a mouse click on a reset button for the calling form.

submit

Submits the form.

tags

Retrieves a collection of objects that have the specified HTML tag name.

 

Properties

The IHTMLFormElement interface has these properties.

Property Description

action

Sets or retrieves the URL to which the form content is sent for processing.

dir

Sets or retrieves the reading order of the object.

encoding

Sets or retrieves the MIME encoding for the form.

length

Sets or retrieves the number of objects in a collection.

method

Sets or retrieves how to send the form data to the server.

name

Sets or retrieves the name of the object.

target

Sets or retrieves the window or frame at which to target content.

 

Remarks

When the form is programmed, all control-like elements are added as named items. In addition, these items are exposed through the item method.

When the focus is on a control in a form, pressing the ESC key once causes the value of the control to revert to the last value. Pressing ESC again resets the form.

If only one text box is on a form, pressing ENTER fires the HTMLFormElementEvents::onsubmit event. If the form has a submit button, the button appears with a dark border, indicating that pressing ENTER submits the form.

The form element is a block element.

This interface may also be referred to in code as IOmForm2.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

IDispatch

Reference

IHTMLFormElement2

IHTMLFormElement3