Share via


INPUT TYPE=file XHTML Element

Send Feedback

The INPUT TYPE=file element creates a file upload element with a text box and Browse button.

Using this Element

There are some common properties and collections that apply to all the elements of the document object model, see Common Properties for All DOM Elements in Internet Explorer Mobile.

This element can be used within a web page with attributes.

This element can be used within scripts where it will have properties, events and methods.

Attributes

Attribute Value PPC SP Description
ACCESSKEY 0...9, #, * Yes Yes Gives access or focus to an active HTML element by using a keypad number.
CLASS   Yes Yes Associates the element with a CSS style.
DISABLED   Yes Yes Disables the element so that it appears dimmed and does not respond to user input.
ID   Yes Yes Uniquely identifies the element within a document.
NAME String Yes Yes Specifies the element name.
ONBLUR   Yes Yes Event that occurs when the element loses focus by the pointing device or by tabbing navigation.
ONCHANGE   Yes Yes Event that occurs when the element loses input focus and its value has been modified since gaining focus.
ONFOCUS   Yes Yes Event that occurs when the element receives focus by the pointing device or by tabbing navigation.
ONSELECT   Yes Yes Event that occurs when the element is selected.
READONLY   Yes Yes Content in this field can not be modified by the reader.
STYLE   Yes Yes Provides the definition of the CSS styles used for this element.
TABINDEX   Yes Yes Sets the order in which elements are tabbed to.
VALUE String Yes Yes Specifies the initial value for the file box.

Scripting Properties

Property Type Access
accessKey string Read/Write
defaultValue string Read/Write
disabled boolean Read/Write
form object Read Only
maxLength long Read/Write
name string Read Only
readOnly boolean Read/Write
size long Read Only
type string Read Only
value string Read/Write

Scripting Events

Event Supported
onchange Yes
onfocus Yes
onblur Yes

Scripting Methods

Method Support Comments
focus Yes Syntax:

file.focus()

  • Sets focus to the checkbox.
select Yes Syntax:

file.select()

  • Selects the file input area and highlights it.

Requirements

Pocket PC: Windows Mobile 5.0 and later
Smartphone: Windows Mobile 5.0 and later
OS Versions: Windows CE 5.01 and later

See Also

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.