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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:29:39+00:00 2026-06-11T10:29:39+00:00

I have a form that is using .change() and .submit() to upload a photo

  • 0

I have a form that is using .change() and .submit() to upload a photo as soon as a user selects one. I’m now trying to implement a disabled on the input file after the submit() has started to avoid multiple uploads at the same time.

HTML:

  <form action="includes/photos.php" id="joinPhotoUploadForm" enctype="multipart/form-data">
    <input type="file" name="file" id="file"><br>
  </form>

JQUERY:

$('input#file').change(function() {
    $('form#joinPhotoUploadForm').submit();
    $('input#file').prop('disabled', true);     // Prevent Multiple Files Uploads
  }
});

The catch is under IE only the input#file is disabled before the .submit() starts on the second upload onwards.

Is there a way to prevent the disabled from occuring until the .submit() has started?

Is there another way to achieve this? something else I could disable? Could I unbind the .change()? Note: the disable is enabled later (after ajax return successfully).

thankyou

  • 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-11T10:29:40+00:00Added an answer on June 11, 2026 at 10:29 am

    You need to prevent the form from submitting again if the file input is disabled. the second eventListener will do that for you.

    $('input#file').change(function() {
        $('form#joinPhotoUploadForm').submit();
        $('input#file').prop('disabled', true);     // Disable to Prevent Multiple Files Uploads
    });
    
    $("#joinPhotoUploadForm").submit(function(e) {
      if ($(this).find("#file").is(":disabled")) {
        e.preventDefault();
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to submit a form that have many checkboxes with different values, using
I have a form on a webpage that I submit using the jquery form
I have a form that contain a submit button. I'm using form.validation plugin I
I have a form that I am using AJAX to pass values with. The
I have a basic form that I'm using for member registration. I'm using the
this is a simple question. I have a form that is being validated using
I have a contact form that can be hidden using .slideToggle() but I want
I have a dynamic form that is to be displayed using an iPad. This
(Using MySQL and PHP) I have a search form that will allow my users
I have a form in my application that will fill using Unicode characters (Non

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.