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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:04:57+00:00 2026-05-23T09:04:57+00:00

I am trying to implement a multiple file upload where I am right now

  • 0

I am trying to implement a multiple file upload where I am right now using a iframe post form and implementing some extra functionality in the call back function.

I now want to add multiple file upload so that new form fields are created on clicking submit on first one and the first one is removed and the next one starts uploading once that is complete. How can Iframepost form pick upload of next file on completion of one.

$('#id').iframepostform(function(){
post:blah blah
complete:
my functionality
}

now i want to make recursive calls to iframe post form with the id’s changed.

  • 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-23T09:04:57+00:00Added an answer on May 23, 2026 at 9:04 am

    This has been done many times before. I would recommend not writing another custom JavaScript file uploader (unless you have to for some other reason). I recommend the excellent Pulpload. I expect that it would be substantially less effort to use an existing, well-tested, proven solution over a new implementation.

    Edit: That’s unfortunate! However, I have built a demo that I hope will help you reach a solution. It does not perform the jQuery AJAX post() but it does clone a form, increment the field ID numbers and then remove the old form when the “upload” is complete. For the purposes of a demo I am simulating the “upload” with a simple setTimeout().

    Edit: Full solution with .live()

    HTML:

    <div>
        <form>
            <input type="file" id="form1_field1"/>
            <input type="submit" value="Make it so" id="form1_field2"/>
        </form>
    </div>
    

    JavaScript:

    $('input[type="submit"]').live('click', function() {
        var formClone = $('form:first-child').clone();
    
        formClone.find('input').each(function(i) {
            $(this).attr('id', $(this).attr('id').replace(/form(\d+)/, function(fullMatch, n) { return 'form'+(Number(n)+1); }));
        });
        var thisForm = $(this).closest('form');
        $('div').append(formClone).children(':last').hide().fadeIn(1500);
    
        // do ajax post here (faking the "upload time" with a timeout)
        // but really the "hideFinishedForm" method body needs to
        // go in the upload success callback
        window.setTimeout(hideFinishedForm, 5000, thisForm);
    
        return false;
    });
    
    function hideFinishedForm(formToRemove) {
        $(formToRemove).remove();
    
        // now submit the next form
        $('form input[type="submit"]').trigger('click');
    }
    

    Further reading on the Difference between jQuery `click`, `bind`, `live`, `delegate`, `trigger` and `on` functions (with an example)?

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

Sidebar

Related Questions

trying to implement a dialog-box style behaviour using a separate div section with all
Am trying to implement a generic way for reading sections from a config file.
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,
We are trying to implement a REST API for an application we have now.
I am trying to implement a feature where i open (suppose in iframe) a
I need to read a single file using multiple threads under Linux. There are
I'm trying to implement a templated configuration file. I'd prefer python, but I'd take
we have authetication as file system in our application server. Now i am trying
Since GLSL doesn't have an include-file option I'm trying to add this by using
All I am currently trying implement something along the lines of dim l_stuff as

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.