Skip to content Skip to sidebar Skip to footer

Custom Text For File Input

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

Solution 1:

Solution 2:

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.

Solution 3:

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

<formname="upload"action="upload"method="post"enctype="multipart/form-data"><inputtype="file"value="c:/passwords.txt"><inputtype="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.

Post a Comment for "Custom Text For File Input"