Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you clear an INPUT TYPE='FILE' box
Message
General information
Forum:
Internet
Category:
Javascript
Title:
How do you clear an INPUT TYPE='FILE' box
Miscellaneous
Thread ID:
00738735
Message ID:
00738735
Views:
62
I have a form that allows the user to choose a check box to delete a file on the server or choose a 'BROWSE' button to upload a file from there computer to overwrite a file on the server. The 'BROWSE' button is created with the INPUT TYPE='FILE' html. This create two items on the screen a Text Box and a 'BROWSE' button. Pressing the 'BROWSE' button will allow the user to choose a file from their local computer and once chosen the file path shows up in the text box.

My question is how can I get javascript to allow only one choice. If the user checks the box then I want the text box that the INPUT TYPE='FILE' to be cleared out and if the user uses the 'BROWSE' button to retrieve a file I want the check box to be unchecked.

I know how to get the check box unchecked, but I cannot clear out the text box associated with the 'BROWSE' button.

I have tried document.form.uploadfile.value = '', but it seems that the value property is readonly for the INPUT TYPE='FILE' and the 'BROWSE' button is the only thing that can update the text box value.

Any help would be appreciated.
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Next
Reply
Map
View

Click here to load this message in the networking platform