JavaScript Kit > JavaScript Reference > Here

FileUpload Object

Last updated: June 20th, 2004

The fileupload field (<input type="file">) within your form can be accessed and manipulated using JavaScript via the corresponding FileUpload object. To access the field in JavaScript, use the syntax:

document.myform.filefield //where myform and filefield are names of your form/element.
document.myform.elements[i] //where i is the position of the field within form


Events Description
onBlur Code is executed when the focus is removed from the fileUpload field.
onChange Code is executed when user changes the value within the fileUpload field and moves focus away from field.
onFocus Code is executed when the focus is set on the fileUpload field.


Properties Description
accessKey String value that sets/ returns the accessKey for the field.
disabled Boolean value that sets/ returns whether the field is disabled.
form References the form that contains the fileUpload field.
name Reflects the name of the fileUpload field (the name attribute).
type A property available on all form elements, "type" returns the type of the calling form element, in this case, "file".
value A read only string that specifies the file name entered into the fileUpload field.


Methods Description
blur() Removes focus away from the fileUpload field.
focus() Sets focus on the fileUpload field.
select() Selects the input area of the fileUpload field.

Reference List

Right column

CopyRight (c) 2018 JavaScript Kit. NO PART may be reproduced without author's permission. Contact Info