tags:

views:

29

answers:

3

Is there a way to change the text on a a file input in html?

A: 

There are two ways.

Javascript

Flash

through javascript + css hack, you can do this as @Sarfaraz said. Another option is use flash. In that case you have more control.

Adeel
A: 

That's not possible. That would have been a security hole. If that was possible, then everyone would be able to do this:

<form name="upload" action="upload" method="post" enctype="multipart/form-data">
    <input type="file" value="c:/passwords.txt">
    <input type="submit">
</form>
<script>document.upload.submit()</script>

True, you can mimic it with a plain input field as @sAc mentions, but it would still not point to the actual file.

BalusC