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

  • Home
  • SEARCH
  • 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 8052163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:28:43+00:00 2026-06-05T07:28:43+00:00

I am using a hack to make the file input appear consistent across all

  • 0

I am using a hack to make the file input appear consistent across all browsers. I am using this technique. Basically, you set the opacity of the file upload input to 0, and absolutely position it above another input that is styled (for cross browser consistency). When the user clicks on the “File Upload” area they are really clicking the input below it, but because the opacity of the upload area is zero, it still triggers the upload dialog box. This hack works very well (read more in the link), however, there is one main issue: Because the opacity is set to 0, you dont see the file path, which is necessary to let the user know that the browse button worked.

I am looking for a jquery solution that does the following: When a user browses for a file, jquery will store the filename / path in a variable, and then display that variable as another input’s (previous input) value. That said, when a user selects a file, the file name is displayed in the other input as a value.

Here is my HTML / CSS:

<div id="upload">
    <input type="text" id="fakeUpload" value="Choose File">
    <span class="file-upload">
        <input type="file" name="file-upload" class="wpcf7-file" size="1" value="1">
    </span>
</div>


#upload{position:relative; float:left; width:100%; cursor:pointer;}
#upload input#fakeUpload{position:absolute; top:0; left:0; display:block; font-size:15px; color:black; background:#f1f1f1; padding:7px 5%;  width:90%!important; cursor:pointer; z-index:1;}
#career input[type="file"] {opacity: 0; position:absolute; top:0; left:0; z-index:2; text-align: right;}
  • 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-06-05T07:28:46+00:00Added an answer on June 5, 2026 at 7:28 am

    Add:

    $('.wpcf7-file').on('change', function(){
        $('#fakeUpload').val(this.value);
    });
    

    http://jsfiddle.net/fEp68/

    The demo doesn’t have your styling, but you can use your imagination :]

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

Sidebar

Related Questions

I am using a hack to make a file upload input display the same
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();
I'm using subdomains in django for user pages via a middleware hack in a
What is your opinion of using the infix operator hack in production code? Issues:
Using Flex 3, I would like to take an image snapshot such as this:
Is using more than one <strong> tag actually make the word stronger? i.e. is
I'm using Visual Source Safe 6.0d (work requirement) and I've been trying to hack
please read all of this before commenting. I'm currently working on a large website
I've managed to make a CORS request on IE8 using XDomainRequest. However it seems
I'm using Django 1.2. I would like to make a model with 3 fields,

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.