Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3666720
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:54:52+00:00 2026-05-19T01:54:52+00:00

Little question: I’m trying to create a Form to upload a file. Now i

  • 0

Little question: I’m trying to create a Form to upload a file.

Now i got a button to select the file and a submit button.

How can i design it like if i’ve selected a file, the path of it (C:\Users….) is shown in a textbox?`

Thx for help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:54:53+00:00Added an answer on May 19, 2026 at 1:54 am

    To copy the selected file name/path to different text box, first have this JS:

    function CopyMe(oFileInput, sTargetID) {
        document.getElementById(sTargetID).value = oFileInput.value;
    }
    

    And it will work with such HTML:

    <div>
        <input type="file" onchange="CopyMe(this, 'txtFileName');" />
    </div>
    <div>
        You chose: <input id="txtFileName" type="text" readonly="readonly" />
    </div>
    

    Test case: http://jsfiddle.net/yahavbr/gP7Bz/

    Note that modern browsers will hide the real full path showing something like C:\fakepath\realname.txt so to show only the name (which is real) change to:

    function CopyMe(oFileInput, sTargetID) {
        var arrTemp = oFileInput.value.split('\\');
        document.getElementById(sTargetID).value = arrTemp[arrTemp.length - 1];
    }
    

    (http://jsfiddle.net/yahavbr/gP7Bz/1/)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might sound like a little bit of a crazy question, but how can
Just got a little question when a column got the Datatype Number(6,3) will this
I have this little question that's been on my mind for a while now.
My question seems easy but is little more theoretical than it looks. There are
First question on here so please be nice :) I know very little about
I know this question might sound a little cheesy but this is the first
A little help needed. I'm receiving an xml file similar to this: <?xml version=1.0
A little question regarding performance in a Java web app. Let's assume I have
a little question. I have this code, which is works perfect for files, but
I have a little question to community. Does ASP.NET MVC allow to execute an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.