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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:04:59+00:00 2026-05-25T03:04:59+00:00

I have a iframe inside a main page. The when a button(inside form1) is

  • 0

I have a iframe inside a main page. The when a button(inside form1) is clicked inside the iframe, it makes a AJAX call and the response html will be a input type file and input type button inside a form(say form2) and the response will be put in a div to show it as a popup over the normal screen. Using the input type file is user is able to select a file and when button is clicked it will call a function to submit the form and the file wil be uploaded to server.

The requirement is to programmatically click the input type file and display the file open dialog. When the user selects a file, we need to programmatically click the button to submit to the server.

I tried to programmatically click the input type file through javascript from the main page after AJAX response is populated. User is able to select file but programmatically click the button results in “Access is denied” error in IE.

I do not use any js library. Do i need to use any additional library to achieve 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-25T03:04:59+00:00Added an answer on May 25, 2026 at 3:04 am

    The requirement is to programmtically click the input type file and display the file open dialog.

    This requirement cannot be reliably fulfilled. Some browsers will respond to click() on an input type="file", others won’t, others (IE) appear to permit it but then refuse to actually submit the form.

    There is no workaround and no library can avoid the limitation—short of going to some non-HTML means of uploading a file such as Flash or Java.

    What’s more there is nothing in the HTML standard that requires there to even be a file open dialog. This is a browser- and OS-specific interface detail. Other platforms than Windows desktop browsers may have other mechanisms for submitting files, such as drag and drop. You can’t meaningfully interact at this level with a file upload field.

    When the user selects a file, we need to programmtically click the button to submit to the server.

    Well that bit’s doable. Catch the change event:

    <form method="post" action="..." enctype="multipart/form-data">
        <input type="file" id="f"/>
    </form>
    
    document.getElementById('f').onchange= function() {
        if (this.value!=='')
            this.form.submit();
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have few pages that I show from my main page inside iframe .
i have iframe inside a page, and this iframe contain a submit button which
I have page with other asp.net page inside iframe. And on button click inside
I have an iframe (iframe.php) inside my main page (index.php). I want to echo
Let's say I have an iframe page (iframe.html). Inside this page, I have a
I have a main page (main.html) which opens an iframe page (iframe.html).. The iframe
I have a page being loaded in an <iframe> . Inside the <iframe> ,
I have a page with an iframe. Inside the iframe is code (that I
Let's say I have an iframe on a HTML page: <iframe src=/script.php></frame> The iframe
I have an iframe on my main page, and this iframe uses php code

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.