Discussion Locked

How to modify look of type="file" input?

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Does anyone know how to specify css button attributes for the type="file" input field? Any class I use gets applied to both the input field AND button, when I want to modify the button and text box separately.
Any idea of how to target those elements individually when using this tag?

3 replies

by tony

We did find a workaround using two frames that works in IE, but we had to write a separate section of code for other browsers.

It uses a hidden input type="file" tag and a visible text input tag. When you click the browse image, it triggers the click of the file input tag. The text input field then gets set to the value of the file input tag.

It was difficult to make it work, but it passed the proof-of-concept phase.

Tony Brandner

by robsutherland

It seems to me to make more since to just hide the visibility of the field instead of using 2 forms with a hidden

. The JavaScript would be about the same, but you avoid the confusion of multiple forms.

Rob

This discussion is closed to new replies.