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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:02:01+00:00 2026-05-29T10:02:01+00:00

I have a problem where my form works in all browsers, except for IE.

  • 0

I have a problem where my form works in all browsers, except for IE.

I have reduced the problem to the smallest that still have the problem.

I have created a test html file that looks like this:

<html>
  <body>
    <form id="myform" action="/" method="post" enctype="multipart/form-data">
      <input id="fileToUpload" type="file" size="10" name="fileToUpload" />
      <input id="mysubmit" type="submit" value="submit"/>
    </form>
    <script src="jquery-1.5.1.js" type="text/javascript"></script>
    <script type="text/javascript">
      $( function(){
       *$("#mysubmit").click(function(){
         *$("#fileToUpload").click();
       *});
      });
    </script>
  </body>
</html>

What I’m trying to do here is to have the submit button first open the file selection box, and then submit the form. The reason is that i want to hide the file selector so the user can click the button, select the file from the dialog, and then get the form posted back immediately.

In “real life” it’s a bit more complicated, since Firefox and Chrome does not wait for the file selection dialog to close before continuing the script after $("#fileToUpload").click();, and Internet explorer waits till it’s closed before continuing. But those things I can manage to handle.

But in this case, IE does not perform the postback of the form at all. If I remove the lines prefixed with star above, IE will also post it back. I also tried putting a $("#myform").submit(); at the end there, but I had no luck with that either. No postback.

Anyone have any clue how to solve this?

  • 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-29T10:02:03+00:00Added an answer on May 29, 2026 at 10:02 am

    I think its not possible, I played around with it here: http://jsfiddle.net/K35tB/5/ Also using timers to check if the fileToUpload contains something and later try to trigger the postback. Whats happend is that I get the message “Access deny” If I do the postback after the FileToUload have been trigged. If I perform the postback before, its works. So its related in some way.

       $("#mysubmit").click(function(){
          document.getElementById("fileToUpload").click();
          document.forms["myform"].submit(); // JavaScript error, No permission / Access denied (Åtkomst nekas in Swedish ;-))
       });
    

    But of course this code work

    document.forms["myform"].submit();
    

    I was playing with IE 8.0.7
    If you check the Fiddle example and modify it and run the timer version you will see that the path is visible for a secound, and when we perform the Submit it disappers.

    Maybe you should try do doing the same using http://swfupload.org/ or some other component. If its not a requirment in your project to use pure HTML controls. Hope it helped in someway!

    Edit 1:
    I tried some more examples, and it works correct if you put the fileToUpload outside the form tag. So it incresse my thoughts that is some kind of security thing. I also tried to put the fileToUpload outside the form, and just before postback modifying the DOM and insert it into the form. Same result, access denied…

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

Sidebar

Related Questions

I have a problem. The client is claiming that a prize signup form I
i have bought a template that have built in contact form problem is that
I have a simple textarea which works in all browsers i.e. I can click
I have a page that selects all the elements in a form and serializes
I have implemented through jQuery the placeholder HTML 5 attribute for the browsers that
I have a site that uses JS and jQuery and works fine on all
I have problem with TinyMCE editor. I have form with few text fields and
I have problem in declaring the intents on my app. I have a form
i have an asp.net form and an asp:textbox. i have a problem when the
I have the following problem: I have a form in site/banen (currently local running

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.