August 15th, 2003, 11:44 AM
input type=file - hiding the text box
I'm currently writing a page which makes use of the <input type="file" /> object, and i am wanting to make the text box part hidden. is this possible? i haven't been able to find a way to reference the text box, only the entire input object (which includes the browse button).
The only other idea i've had (which didn't work!) was to hide the entire thing, and launch the file browser from other button with the fireEvent method but i don't know what method to call.
Anybody got any ideas?
August 15th, 2003, 03:37 PM
Its not possible, as far as I know.
August 19th, 2003, 04:35 AM
I found the answer for anyone who was interested:
<input id="selectedFile" type="file" onpropertychange="add()" style="position:absolute;visibility:hidden;"/>
<input type="button" id="browseButton" value="Browse..." onclick="selectedFile.click()">
September 29th, 2003, 03:19 PM
this is beautiful playerone, exactly what I was looking for. ThanX.
April 3rd, 2004, 12:19 AM
hide browse input box
This doesn't work by itself in IE 5.5. Is that the whole thing? Or is it just for Mozilla?
Originally Posted by playerone
I get error message about onpropertychange="add()
April 3rd, 2004, 08:00 AM
You must have defined add() as a function. As this is written, it should work only in IE 5+. Try this:
That should work in Mozilla and IE.
<input type="file" id="selectedFile" style="display: none;" />
<input type="button" value="Browse..." onclick="document.getElementById('selectedFile').click();" />
Hope that helps!