Dean A. Hoover wrote:
I've
been reading some interesting methods for
using image buttons on forms in place of the
familiar "Submit" style browser generated
buttons. There is one automatically generated
button that I am still puzzled on how to use
an image for it, though. That's the one for
do file uploading, as in:
<html:form method="POST" enctype="multipart/form-data">
<html:file property="theFile"/>
<html:submit value="Upload"/>
</html:form>
Any ideas?
Dean Hoover
As a start, here is the FileUpload object created by <input
type="file">: Hope this goest through, but, if not, then see
http://www.w3schools.com/htmldom/dom_obj_fileupload.asp
Michael McGrady
<pre>
HTML DOM FileUpload Object
FileUpload Object
For each instance of an HTML <input type="file"> tag on a
form, a FileUpload object is created.
All FileUpload objects are stored in the elements array of the
corresponding form. You can access a FileUpload object by indexing this
array - either by number (0 represents the first element in a form) or
by using the value of the name attribute.
The FileUpload object's properties, methods, and events are
described below:
N: Netscape (including Mozilla when N6 or higher), IE:
Internet Explorer, W3C: World Wide Web Consortium (Internet
Standard)
Properties
Syntax: object.property_name
Property |
Description |
N |
IE |
W3C |
accept |
Sets or returns a list of content types that the
server that processes this form will handle correct |
|
- |
Yes |
accessKey |
Sets or returns the keyboard key to access the
FileUpload object |
|
4 |
Yes |
align |
Sets or returns the alignment of the FileUpload
object according to the surrounding text |
|
- |
Yes |
alt |
Sets or returns an alternate text to display if
the browser does not support <input type="file"> |
|
- |
Yes |
defaultValue |
Sets or returns the initial value of the
FileUpload object |
3 |
4 |
Yes |
disabled |
Sets or returns whether or not the FileUpload
object should be disabled |
|
4 |
Yes |
form |
Returns a reference to the form that contains
the FileUpload object |
3 |
4 |
Yes |
id |
Sets or returns the id of the FileUpload object
(In IE 4 this property is read-only) |
|
4 |
No |
name |
Sets or returns the name of the FileUpload object |
3 |
4 |
Yes |
tabIndex |
Sets or returns the index that defines the tab
order for the FileUpload object |
|
4 |
Yes |
type |
Returns the type of the form element. For a
FileUpload object it will be "file" |
3 |
4 |
Yes |
value |
Returns the file name of the FileUpload object
after the text is set by user input |
3 |
4 |
Yes |
Methods
Syntax: object.method_name()
Method |
Description |
N |
IE |
W3C |
blur() |
Removes focus from the FileUpload object |
3 |
4 |
Yes |
click() |
Simulates a mouse-click on the FileUpload object |
|
4 |
No |
focus() |
Gives focus to the FileUpload object |
3 |
4 |
Yes |
select() |
Selects the FileUpload object |
|
4 |
Yes |
Events
Syntax: object.event_name="someJavaScriptCode"
Event |
Description |
NN |
IE |
W3C |
onBlur |
Executes some code when the FileUpload object
loses focus |
3 |
4 |
|
onClick |
Executes some code when the FileUpload object
gets a mouse click |
3 |
4 |
|
onFocus |
Executes some code when the FileUpload object
gets focus |
3 |
4 |
|
onSelectStart |
Executes some code when the FileUpload object
gets selected |
|
4 |
|
</pre>
|
<<inline: btn_previous.gif>>
<<inline: btn_next.gif>>