Display text "loading..." after file is selected in input type="file" element
I am using a really simple form to allow users to upload files to my
server. It works well, but i have noticed that even for very small files,
right after selecting the file to upload, it takes a while (2-3 sec) to
change the "No file selected" to the actual name of the file selected.
(Actually it says it in spanish - guess somebody knows where i am).
The thing is that during this loading time the mouse wheel nor the browser
look like they are thinking, so im afraid the user wont be patient enough
and will feel its not working.
So i just want to display a text saying, "hey, hold on - its loading" And
this is what i have tried with no luck:
A.
<input type="file" name="userf"
onload="function(e){e.innerHTML='Loading';};">
</input>
B.
<input type="file" name="userf"
onchange="function(e){e.innerHTML='Loading';};">
</input>
C.
<input type="file" name="userf"
onload="function(){this.innerHTML='Loading';};">
</input>
D.
<input type="file" name="userf"
onchange="function(){this.innerHTML='Loading';}">
</input>
If this is not possible, could i not just change the default message: "No
file selected"?
EDIT If possible, no JQuery, just javascript
No comments:
Post a Comment