Forums
This topic is locked
clearing file input
Posted 07 Jan 2005 00:13:23
1
has voted
07 Jan 2005 00:13:23 Tim Timleck posted:
I have a form with several text inputs, and 3 file input fields that are optional. I need to have the ability to clear or reset each file input. If a user browses a file and then decides against it, I have a button beside each to clear, but setting value to "" doesn't work because browsers ignore value on file inputs, and disabled = ture fails on file inputs, and reset buttons resets the whole form. Any help is appreciated. Replies
Replied 07 Jan 2005 01:16:02
07 Jan 2005 01:16:02 Chris Charlton replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>...If a user browses a file and then decides against it, I have a button beside each to clear, but setting value to "" doesn't work because browsers ignore value on file inputs, and disabled = ture fails on file inputs, and reset buttons resets the whole form...<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Browsers ignore the <i>value</i> attribute on file fields for security reasons. Imagine someone hides a file field with a default value of an important file on your harddrive? You'd upload a file and never know it!
Browsers ignore the <i>value</i> attribute on file fields for security reasons. Imagine someone hides a file field with a default value of an important file on your harddrive? You'd upload a file and never know it!