changing text

Discussion in 'ASP .Net' started by Vinnie, Oct 7, 2007.

  1. Vinnie

    Vinnie Guest

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

    Thanks

    Vinnie
    Vinnie, Oct 7, 2007
    #1
    1. Advertising

  2. Vinnie wrote:
    > 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.

    --
    Göran Andersson
    _____
    http://www.guffa.com
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Oct 7, 2007
    #2
    1. Advertising

  3. 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>



    "Vinnie" <> wrote in message
    news:...
    > having an "upload file" control on my page, how can i change the text
    > on the button from "browse" into something else?
    >
    > Thanks
    >
    > Vinnie
    >
    John Timney \(MVP\), Oct 8, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samridhi Kumar Shukla
    Replies:
    1
    Views:
    523
    Alvin Bruney
    Nov 30, 2003
  2. Richard
    Replies:
    3
    Views:
    500
    ghoul-cow
    Dec 22, 2005
  3. Aaron Beall
    Replies:
    2
    Views:
    1,804
    Aaron Beall
    Sep 14, 2007
  4. Replies:
    0
    Views:
    358
  5. Thomas 'PointedEars' Lahn

    Changing text in input text box

    Thomas 'PointedEars' Lahn, Oct 24, 2009, in forum: Javascript
    Replies:
    7
    Views:
    149
    Eric Bednarz
    Oct 26, 2009
Loading...

Share This Page