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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:56:34+00:00 2026-05-20T02:56:34+00:00

I have this code in a common javascript file in my asp.net project. jQuery-Lint

  • 0

I have this code in a common javascript file in my asp.net project.

jQuery-Lint returns “You’ve used the same selector more than once” whenever I mouse over one of the buttons that was affected by this function.

//turns all the buttons into jqueryUI buttons
//#mainBody is on the master page, #childBody is on the modal page.
$("#mainBody button, #mainBody input:submit, #mainBody input:button, #childBody button, #childBody input:submit, #childBody input:button").livequery(function () {
    $(this).button().each(function (index) {
                            $(this).ajaxStart(function () {
                                    $.data(this, "old_button_val", $(this).val());
                                    $.data(this, "old_button_disabled", $(this).button("option", "disabled"));
                                    $(this).button("option", "disabled", true).val("Wait...");
                                }).ajaxStop(function () {
                                    $(this).val($.data(this, "old_button_val")).button("option", "disabled", $.data(this, "old_button_disabled"));
                                }).ajaxError(function () {
                                    $(this).val($.data(this, "old_button_val")).button("option", "disabled", $.data(this, "old_button_disabled"));
                                });
                        });
});

A similar question was asked here.

  • 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-20T02:56:35+00:00Added an answer on May 20, 2026 at 2:56 am
    // Might be a good idea now to add a class to these element
    // instead of using a long selector like this
    // Additionally, :button already includes <button> elements
    var selector = "#mainBody input:submit, #mainBody input:button, #childBody input:submit, #childBody input:button";
    
    $(selector).livequery(function() {
        // Store a copy of $(this), which we'll reuse... and reuse... and reuse
        var t = $(this);
    
        // Create the callback function shared berween
        // ajaxStop and ajaxError
        function ajaxCallback () {
            t.button('option', {
                 label: t.data("old_button_val"),
                 disabled: t.data('old_button_disabled')
             });
        }
    
        t.button()
            .ajaxStart(function() {
                // Use $.fn.data instead of $.data
                t.data({
                    // Using 'label' instead of 'val'
                    // because <button> elements do not have 'value's
                    "old_button_val", t.button('option', 'label'),
                    "old_button_disabled": t.button("option", "disabled")
                }).button('option', {
                    disabled: true,
                    label: 'Wait...'
                });
            }).ajaxStop(ajaxCallback).ajaxError(ajaxCallback);
        });
    });
    

    Disclaimer: Not tested, therefore not guaranteed to work.

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

Sidebar

Related Questions

I have a scenario where the base project consists of java code and web
Recently I have been looking at jquery/javascript solutions to emulating the placeholder attribute, but
Well I know that selenium world is full of file upload threads, and this
I have made some code that creates a red border around an image when
I'm sure this is a common problem for many web applications these days. What
i have a problem with the .java.policy entries for my applet. I would try
I am looking for a c# library that is open source but licensed to
REVISED QUESTION (SEE BELOW FOR ORIGINAL): Here is an example of a simple ajax
I've got some HTML which has some dynamically generated forms which are submitted via
I am starting to build "drill-down" select elements (select elements that filter their options

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.