Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

changing text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vinnie - 07 Oct 2007 23:05 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.