Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Clear a File Field Textbox

Status
Not open for further replies.

RClarkeJr

Programmer
Nov 10, 2004
20
US
I have a File Field Textbox which allows a user to attach a file. Once they have attached the file, I would like to clear the File Field Textbox. I have tried, empty, null, and " ".

Any ideas?

Thank you in advance.
 
Hello RClarkeJr,

Something like this.
[tt]
'above statement for reading the info & attaching
document.forms('formname').elements('textfieldname').value=empty
[/tt]
regards - tsuji
 
I appreciate your advice tsuji, but I have already tried that and it is not effective.
 
RClarkeJr,

I see. If that is type="file" input "field", not exactly a textbox, then use reset on the form.
[tt]
'above statement for reading the info & attaching
[blue]'read all the form fields value except "file" field
'and save it in variables[/blue]
document.forms('formname').reset
[blue]'restore the values of fields you want to restore[/blue]
[/tt]
- tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top