The input[type="submit"][disabled] is malfunctioning on IE8

My input submit button has 3 different states:

  1. Active : Orange button
  2. Mouse down : Dark gray button
  3. Disabled : Light gray button

    <input type="submit" id="savebtn" class="save_button"/>

CSS:

.save_button {
  background: url('/Images/save_button_active.png') no-repeat scroll 0 0 transparent;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  height: 33px;
  padding-bottom: 4px;
  padding-right: 19px;
  width: 216px;
  border: solid 0px;
  color: #fff!important;
  background-position: 0px -30px;
}

.save_button-active {
  background:url('/Images/save_button_mousedown.png') no-repeat scroll 0 0 transparent;
  cursor: pointer;
  font-size:14px;
  font-weight: bold;
  height: 33px;
  padding-bottom: 4px;
  padding-right: 19px;
  width: 216px;
  border:solid 0px;
  color:#fff!important;
  background-position:0px 2px;
  margin-right:20px\0;
}
.save_button[type="submit"]:disabled, .save_button[type="submit"][disabled] {
 background:url('/Images/save_button_disabled.png') no-repeat scroll 0 0 transparent;
 cursor: pointer;
 font-size:14px;
 font-weight: bold;
 height: 32px;
 padding-bottom: 4px;
 padding-right: 19px;
 width: 216px;
 border:solid 0px;
 color:#fff!important;
 background-position:0px 1px;
 margin-right:20px\0;
}

All works fine in Chrome and other IE versions, except for IE8 where the disabled state turns orange with gray text.

I dynamically add active classes using jQuery.

fnMouseDownEvents(buttonObj, mousedownClass, mouseupClass);

The function is called like this:

fnMouseDownEvents('save_button', 'save_button-active', 'save_button')

I have tried various solutions found on StackOverflow, but none have worked. Is there something I am overlooking here?

Answer №1

Could this be the solution you are looking for?

$(".save_button").mouseup(function() {
    $(this).attr("disabled", "disabled");
});

View the code in action on jsfiddle.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The clash between Selenium IDE and a personalized confirm() function

I have implemented a custom confirm dialog using simple modal dialog by Eric Martin. The function I defined is as follows: function confirm(message, options) {.... } My custom confirm dialog works perfectly across all browsers, except when I enable Se ...

"Customize your map pins on Google Maps by updating the marker location through a

I am trying to update the position of a map marker based on a dropdown selection. Upon changing the dropdown option, I retrieve the latitude and longitude values and want to set these coordinates for my current marker. Here is the code snippet: $("#locati ...

Using jQuery to Convert CSV Data into an HTML Table

I've been exploring the incredible jquery.csvtotable.js plugin for converting csv files to html tables. One question that has been on my mind is how can I allow users to select a .csv file using a browse button that isn't a server-side control? ...

Sending a function parameter when registering for an event

I am currently utilizing the jQuery pubsub for creating custom events: (function($) { var o = $({}); $.subscribe = function() { o.on.apply(o, arguments); }; $.unsubscribe = function() { o.off.apply(o, arguments); }; $.publish = fun ...

Elements positioned absolutely using the ::after and ::before pseudo-elements do not adhere to the very bottom of the body

Feeling a bit crazy right now! Haha. I'm facing a challenge in positioning an image at the bottom of a webpage. It seems to work fine when the page width is larger, around 1360px, but as soon as I shrink it to 1206px or less, the image gets pushed up, ...

Obtain the identifier for the Summernote component

I need a solution for retrieving the element ID of multiple summernote fields on a page when performing an action onblur. Currently, my attempts to capture the elements ID result in it being returned as undefined Sample HTML code: <div class="summerno ...

Discover the basics of incorporating libraries using npm

As a beginner in JavaScript, I am looking to incorporate moment.js or another library into my project. However, I am unsure of how to properly set up my project so that I can import from the library. Here is how I have structured my HTML: <!DOCTYPE html ...

Position the Bootstrap footer element at the bottom of the page

On a custom HTML page that I created, I decided to include a footer using Bootstrap. In this example, it demonstrates how the footer can be positioned at the bottom of the page without being placed inside a container element (directly within the body eleme ...

Begin mastering the art of Asynchronous programming in ASP.NET

I'm not looking for advice on learning specific programming languages and technologies like JavaScript, Ajax, and JQuery. I just need guidance on the best choice for enhancing the desktop experience of my web application. To make it easier for you to ...

Conceal a text field depending on the value within a hidden field that was populated automatically by a JavaScript function

I encountered a peculiar issue recently. I have a form with a field for entering card numbers. There is a JavaScript code that automatically detects the type of card (such as Maestro, Visa, etc.) based on the entered number. If the detected card type is &a ...

Nested navigation in Bootstrap

I am currently working on creating a multilevel menu using Twitter Bootstrap. Check out the code here Below is the snippet of HTML code: <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> ...

What is causing this code to break when using ajax's `data` parameter?

I'm relatively new to JavaScript, and I've been working on some code that seems to be properly formatted. However, whenever I add the data elements, it breaks the code. I've checked the jQuery documentation and as far as I can tell, I'm ...

Errors can be thrown when using React and classNames in the class component

I'm relatively new to React and currently working on a large project. I've run into an issue where I can't use both class and className on all elements and components, particularly custom ones. To work around this, I've had to place the ...

PHP Loop creating additional space in recurring section

I'm facing a perplexing issue that I can't seem to figure out. When I use the code provided below, it creates an extra blank row on my webpage. Interestingly, this code works perfectly fine on other pages without any issues. Although I have set t ...

Apply CSS styling to options specifically in Internet Explorer

How can I style options in a select list using CSS? I have successfully styled the options in Mozilla Firefox, but the styles do not apply in Internet Explorer and Chrome. Here is a jsFiddle link for IE <select class="mapField"> <option valu ...

Discover ways to retrieve an ajax response from a different domain by submitting specific data to the controller method while operating on an internet server

I am facing an issue where I am unable to retrieve array data from a Codeigniter controller using an Ajax request. The data is being posted to the controller to fetch related data from the database, and it works perfectly fine on my local server. However, ...

Looking to duplicate a row of input fields while maintaining the same validation rules as the original row?

form <form action="assign_web_menu_action.php" method="post" name="form1" id="form1" > <table id='menuAssign'> <tbody> <tr class="clone_row"> <td> <input type="text" name="menuname[]" id="menuname1" ...

The HTML image link is adorned with a tiny blue checkmark underneath

My a tag with an image inside seems to be extending below the image, resulting in a small blue tic mark on the bottom right side. I've attempted different CSS solutions such as setting border to none, but nothing has resolved the issue. Any assistance ...

Creating a JavaScript function that adds a loader to a specific button element

I'm looking to develop a universal function that I can use on all my buttons. This function will embed a loading image into the button by applying a class when it's clicked, and then hide the image once the associated action is completed. Is the ...

Is the OnClientUploadStart function failing to work correctly with the "UploadStart" attribute?

Hey everyone, I'm currently working on an Ajax file upload feature and everything seems to be in order except for the function which is not working properly. OnClientUploadStart="UploadStart" I'm unsure of what mistake I might have made here. C ...