Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Can the "Browse..." caption be changed?

Can the "Browse..." caption be changed?

Scheduled Pinned Locked Moved ASP.NET
question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    naveedmazhar
    wrote on last edited by
    #1

    Assalam-O-Alaikum! Can the "Browse..." caption of the "Browse Button" be changed. I am talking about Take care. Allah Hafiz

    M 1 Reply Last reply
    0
    • N naveedmazhar

      Assalam-O-Alaikum! Can the "Browse..." caption of the "Browse Button" be changed. I am talking about Take care. Allah Hafiz

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, I don't think you can. However, there is a work-around option is to use a normal button which allows you to set whatever you want as its caption, and use a hidden input file element to browse the files on the client machine.

      E 1 Reply Last reply
      0
      • M minhpc_bk

        Hi there, I don't think you can. However, there is a work-around option is to use a normal button which allows you to set whatever you want as its caption, and use a hidden input file element to browse the files on the client machine.

        E Offline
        E Offline
        enjoycrack
        wrote on last edited by
        #3

        hi, Do u have any available source code/links about this? pls show me. Thanx << >>

        M 1 Reply Last reply
        0
        • E enjoycrack

          hi, Do u have any available source code/links about this? pls show me. Thanx << >>

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          You basically have 3 elements: textbox, button, and hidden input file.

          <input id="TextBox1" type="text">
          <input type="button" value="Browse Files" onclick="BrowseFile();">
          <input id="File1" style="visibility:hidden" type="file" name="File1" runat="server"
          onpropertychange="SelectFile();">

          <script type="text/javascript">
          function BrowseFile()
          {
          document.getElementById("File1").click();
          }

          function SelectFile()
          {
          	var filePath = document.getElementById("File1").value;
          	document.getElementById("TextBox1").value = filePath;
          }
          

          </script>

          However, this way only works with IE, since in FF the input file element (an instance of the HtmlInputElement with type=file) does not support the click method. If you can make it work in FF, I would be interested in knowing how.

          E 1 Reply Last reply
          0
          • M minhpc_bk

            You basically have 3 elements: textbox, button, and hidden input file.

            <input id="TextBox1" type="text">
            <input type="button" value="Browse Files" onclick="BrowseFile();">
            <input id="File1" style="visibility:hidden" type="file" name="File1" runat="server"
            onpropertychange="SelectFile();">

            <script type="text/javascript">
            function BrowseFile()
            {
            document.getElementById("File1").click();
            }

            function SelectFile()
            {
            	var filePath = document.getElementById("File1").value;
            	document.getElementById("TextBox1").value = filePath;
            }
            

            </script>

            However, this way only works with IE, since in FF the input file element (an instance of the HtmlInputElement with type=file) does not support the click method. If you can make it work in FF, I would be interested in knowing how.

            E Offline
            E Offline
            enjoycrack
            wrote on last edited by
            #5

            Thanx for the reply << >>

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups