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 9217269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:35:59+00:00 2026-06-18T02:35:59+00:00

I have stylized My File input using : <html> <head> <style> #yourBtn{ position: relative;

  • 0

I have stylized My File input using :

<html>
<head>
<style>
#yourBtn{
 position: relative;
 top: 150px;
 font-family: calibri;
 width: 150px;
 padding: 10px;
 border-radius: 5px;
 border: 1px dashed #ddeeff; 
 text-align: center;
 background-color: #ffddee;
 cursor:pointer;
 color:#333333;
}
</style>
<script type="text/javascript">
 function getFile(){
document.getElementById("upfile").click();
 }
 function sub(obj){
 document.getElementById("yourBtn").innerHTML = "Uploading Please Wait...";
 document.myForm.submit();
 event.preventDefault();
 }
</script>
</head>
<body>
<center>
<form action="/sub/upload.php" method="POST" enctype="multipart/form-data" name="myForm" target="myiframe">
<div id="yourBtn" onclick="getFile()">click to upload a file</div>
<div style='height: 0px;width: 0px; overflow:hidden;'><input id="upfile" type="file" name="upload" style="display:none;" onchange="sub(this)" /></div>
</form>
<iframe name="myiframe" style="width:100;height:100;border:2px solid #bbccdd;"></iframe>
</center>
</body>
</html>

The Problem is .submit() function returns the ‘ Access Denied ‘ error on IE (tested in IE8 and 9). Works fine in all other browsers (chrome,opera,safari and Firefox). when the sub(obj) is invoked. And The same is happening even if i use Jquery also.

So Can any one tell me how should i get this script working on IE ?

  • 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-18T02:36:00+00:00Added an answer on June 18, 2026 at 2:36 am

    As noted above IE does not allow you to open the dialog and submit a file on the user’s behalf through javascript. That being said, your idea of styling the “file input” is completely valid.

    This link may help you with that:

    Styling File Inputs

    It’s a buggy work around to say the least but the general gist is this:

    1. Create a file input and set the opacity using css to 0.0. Do not set
      visibility as this will disable the input.
    2. Style a regular text input to your liking using CSS so that it looks like the file input you desire.
    3. Position the text input and add a z-index of 0.
    4. Position your file input (that is completely transparent) and give it z-index of 1.
    5. Write javascript to pull the value of the file input (i.e. in jQuery

      $('input[type="file"]').val();
      

      and place it in the text input.

    The idea here is that the file input is still pulling the file and the user is still choosing the file. You’re in a sense, masking it and making it appear as if you have a custom control. Really, your fake control is behind the real one which is simply transparent.

    Hope this helps

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

Sidebar

Related Questions

have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I have found nice code, that stylize checkboxes. HTML: <input id=checkbox type=checkbox class=checkbox />
I've got a stylized input I'm working on in html/css that achieves the look
I tried to build an application using Javascript, HTML, CSS, AJAX, JSON in which
Have got a method which returns IEnumerable<User> which I have been using Linq /
I have two questions regarding to html table layout. First I will provide some
I'm using Apache POI to export data to a .xlsx file and I want
On one HTML Page ( From.htm ) I have: <table class=Contents Stylize General> <tr>
I am using custom shortcodes for my post editor and i now have multiple
I have a simple form <div id=stylized class=myform> <form id=mysmartform> <h1>CourtSmart Server Status</h1> <p>Are

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.