How to clear an input type=file?

T

ThunderMusic

Hi,
I have a page where I have an input type=file control and many other
controls... the thing is, when I cause a postback by any control on the
page, if a file is selected in the input type=file, the file is posted...
so I want to clear the file in the input on all submit except when the
upload button is pressed... actually, with an alert, I can display the
value of the input type=file when it should be cleared and it does not
display when it should not be cleared... so the processing is good for when
I have to clear, but just setting the value to '' does not work... I've
read on the net that it's impossible to modify the value of an input
type=file... There must be a way to clear?!?

How can I clear it? I don't want to put another filename in it, I just want
to clear it...

Will a form.Reset will do the trick or will it cancel the postback?

thanks

ThunderMusic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,264
Messages
2,571,065
Members
48,770
Latest member
ElysaD

Latest Threads

Top