Share via


form HTML Object

The form object represents an HTML input form. It corresponds to the FORM HTML element.

Properties

Property Data type Access Description
action String Read/write Specifies the URL where the form content is sent for processing.
encoding String Read/write
Specifies the MIME encoding for the form data when the form is submitted.

Although writable, the value of this property is always application/x-www-form-urlencoded.

method String Read/write Specifies how the form data is sent to the server. The only valid values are post and get.

get specifies that the data is appended to the URL specified by the action property.

put specifies that the data is sent in the body of the HTTP request.

name String Read-only Retrieves the name of the form.
target String Read/write Specifies the name of the frame or window where the results of submitting a form are displayed.

Note   Frames are supported by Pocket PC compatible devices. SmartPhone does not support frames.

Events

Event Description
onreset Occurs when a form is about to be reset or when the reset method is called.
Note   Supported only for devices running Windows Mobile 2002 software or later.
onsubmit Occurs when a form is about to be submitted and only when the submit is initiated by the user. It does not occur if the submit method is called on the form.

Methods

Method Syntax Description
reset form.reset Simulates a mouse click on the reset button, which resets the form back to its initial state. This method first invokes the onreset event.
submit form.submit Submits the form but does not invoke the onsubmit event.

Collections

The following collection is supported for the form object:

Requirements

Smartphone: Windows Mobile 2002 and later
OS Versions: Windows CE 3.0 and later

Last updated on Friday, April 22, 2005

© 2005 Microsoft Corporation. All rights reserved.

Send feedback on this topic to the authors.