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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:25:09+00:00 2026-06-13T07:25:09+00:00

Language: Javascript (PHP page) I have 2 buttons on a page: — One is

  • 0

Language: Javascript (PHP page)

I have 2 buttons on a page:
— One is an upload image button (#upload),
— & another is a “save / submit form” button (.multi-accordion-submit).

What the .js below does is it disables the submit button (.multi-accordion-submit) while files are being uploaded while user uses the other button (#upload) & text inside #upload says “Uploading…”.

After an upload & text goes back to “Upload More” for #upload, the .multi-accordion-submit button’s disabled attribute should now be removed.

But the problem is, it remains disabled and unclickable, rendering the submit button (.multi-accordion-submit) useless.

I don’t know how to fix it, the code below looks fine & should work.

Any guidance and assistance would be greatly appreciated! Thanks for your time.

$(function () {
    var btnUpload = $('#upload');
    var status = $('#status');
    var url = $('#upload_path').val();
    new AjaxUpload(btnUpload, {
        action: url,
        //Name of the file input box
        name: 'image',
        onSubmit: function (file, ext) {
            $('#upload-error').hide();
            if (!(ext && /^(pdf|ai|psd|bmp|cdr|clk|gif|jpg|jpeg|ppt|pub|doc|docx|pcx|pic|pict|pct|png|ps|tif|tiff|emf|wmf|indd)$/.test(ext))) {
                // check for valid file extension 
                $('#upload-error').show();
                return false;
            }
            btnUpload.text('Uploading...');
            $('.multi-accordion-submit').attr('disabled', true);
        },
        onComplete: function (file, response) {
            if ($('.file-elements').length > 0) {
                if ($('.file-elements:visible').length == 0) {
                    window.location.href = document.location.href;
                } else {
                    btnUpload.text('Upload More');
                    $('.multi-accordion-submit').attr('disabled', false);
                }
            } else {
                btnUpload.text('Upload More');
                $('.multi-accordion-submit').attr('disabled', false);
            }


            //Add uploaded file to list
            if (response === "success") {
                $('<li></li>').appendTo('#files').html(file).addClass('upload-files');
            } else {
                $('<li></li>').appendTo('#files').text(file).addClass('upload-files');
            }
        }
    });
});
  • 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-13T07:25:10+00:00Added an answer on June 13, 2026 at 7:25 am
    //try to use
    $('.multi-accordion-submit').attr('disabled','disabled'); 
    //and
    $('.multi-accordion-submit').removeAttr('disabled');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have 1 php page containing 2 forms and 1 submit button.i want to
I have this Javascript: <script language=javascript type=text/javascript> $().ready(function() { $('#ex2').jqm({ajax: 'view.php?id=<?=$objResult[id];?>', trigger: 'a.ex2trigger'}); });
I have a page with code... <script language=JavaScript> var link = <img src='http://www.mysite.com/file.php?var1=firstName&var2=lastName&var3=phone'>; document.write(link);
I have a page like this: <html> <head> <script language=javascript type=text/javascript src=jquery-1.4.2.min.js></script> <script language=javascript
I have an html page with a form and a submit button. Once I
I have a form, when the user clicks on the submit button this javascript
I want to use a scripting language(Javascript, PHP) to achieve the following task. 1)I
Is there a way to have Expression Language (EL) expressions included JavaScript files be
I have a file script.js.php . It contains PHP and JavaScript code(the js depends
I have a Popup button written in JavaScript. When user clicks that button, it

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.