having an "upload file" control on my page, how can i change the text
on the button from "browse" into something else?
Thanks
Vinnie
Göran Andersson - 07 Oct 2007 23:40 GMT
> having an "upload file" control on my page, how can i change the text
> on the button from "browse" into something else?
You can't. The browser decides how the upload control should look, and
there are no properties to control how the browse button should appear.

Signature
Göran Andersson
_____
http://www.guffa.com
John Timney (MVP) - 08 Oct 2007 09:54 GMT
I had this example sitting in a code archive I keep.
Never tried it but it might work.
Regards
John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
<html>
<head>
<title>Browser Button Fix</title>
<!-- By: Matt McHugh //-->
<style type="text/css">
input.hide
{
position:absolute;
left:-137px;
-moz-opacity:0 ;
filter:alpha(opacity: 0);
opacity: 0;
z-index: 2;
}
input.red
{
background-color:#cc0000;
font-weight:bold;
color:#ffffff;
z-index:1;
width:75px;
height:20px;
font-size:10px;
}
</style>
<!--[if IE]>
<style type="text/css">
input.hide
{
position:absolute;
left:10px;
-moz-opacity:0;
filter:alpha(opacity: 0);
opacity: 0;
z-index: 2;
width:0px;
border-width:0px;
}
</style>
<![endif]-->
<script type="text/javascript">
function buttonPush (buttonStatus)
{
if (buttonStatus == "depressed")
document.getElementById("pseudobutton").style.borderStyle = "inset";
else
document.getElementById("pseudobutton").style.borderStyle = "outset";
}
</script>
</head>
<body>
<input type="button" class="red" id="pseudobutton" value="Open File">
<input type="file" class="hide" id="openssme"
onmousedown="buttonPush('depressed');" onmouseup="buttonPush('normal');"
onmouseout="buttonPush('phased');">
</body>
</html>
> having an "upload file" control on my page, how can i change the text
> on the button from "browse" into something else?
>
> Thanks
>
> Vinnie