changing text

V

Vinnie

having an "upload file" control on my page, how can i change the text
on the button from "browse" into something else?

Thanks

Vinnie
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Vinnie said:
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.
 
J

John Timney \(MVP\)

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top