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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:41:18+00:00 2026-05-30T08:41:18+00:00

I am using multiple uploadify instances on single page. But the problem is that

  • 0

I am using multiple uploadify instances on single page. But the problem is that when I submit the form,form gets submitted before the upload of all the files.

I tried event.preventDefault(); to prevent the form submission before the image upload. but I am not getting the solution. Please suggest me some way by which I can prevent the form submission until all the uploadify files gets uploaded.

Here is my function

$("#add_facility_form .form-submit").click(function(event){

        event.preventDefault();
      $('#gallary').uploadifyUpload();
      $('#brochures').uploadifyUpload();
      $('#award_logo').uploadifyUpload();
      $('#acc_logo').uploadifyUpload();
      $('#file_upload').uploadifyUpload();

       $("#add_facility_form").submit();
  });
  • 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-30T08:41:19+00:00Added an answer on May 30, 2026 at 8:41 am

    I would suggest using classes for your file uploads – will reduce your jQuery code .. for example …

    <input type="file" id="file1" name="file1" class="uploadifyfile" />
    <input type="file" id="file2" name="file2" class="uploadifyfile" />
    <input type="file" id="file3" name="file3" class="uploadifyfile" />
    

    Then your jQuery becomes :

    $("#add_facility_form").submit( function(event){
        $('.uploadifyfile').uploadifyUpload(); // uses class instead of multiple IDs
        if (numFilesUploaded < $(".uploadifyQueueItem").length) { return false; }
    });
    

    Then when you initialise the uploadify elements add an onComplete method to keep a track of the completed uploads :

    $(".uploadifyfile").each(function () {
        $(this).uploadify({
           'onComplete': function (event, queueId, fileObj, response, data) {
             incrementUploadedCount();
           }
        });
    });
    

    Then create a variable for keeping a track of the completed uploads then in the incrementUploadedCount function check that all have been complete, if they have submit the form

    // keep track of uploaded count 
    var numFilesUploaded = 0;
    
    function incrementUploadedCount() {
        numFilesUploaded++; // increment complete count
        // check if complete count matches number of uploadify elements
        if (numFilesUploaded == $(".uploadifyQueueItem").length) {
             // submit your form
             $("#add_facility_form").submit();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the uploadify jquery plugin to upload multiple files. Everything works fine, but
Im using multiple instances with valums fileuploader , but it seems that uploader only
I am using Jquery Uploadify for images upload with PHP, here i have multiple
I am facing a really weird problem. I am using swfupload to upload multiple
I am using 'Uploadify' Jquery plugin in my MVC 3.0 application to upload multiple
I am using Uploadify to upload multiple files in my ASP.NET MVC application. In
So I'm using uploadify to upload multiple images to a folder. Along with each
I am using uploadify plugin of jquery and have set multiple files upload to
Does using Multiple .NET Languages (Delphi, VB.NET, C#) into the same application (but in
I am using multiple instances of AVAudioPlayer to play multiple audio files simultaneously. I

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.