• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 385
  • Last Modified:

disabled = true does on work using Firefox

In Javascript using Internet Explorer, I'm disabling a button, like this:

var btn = document.getElementById("ctl00_PageContent_btnNext__Button");
btn.disabled = true;

However this does not work using Firefox.  Now, I have read numerous articles on various sites on this issue, and none of the solutions have worked.  I'm looking for a solution that works.   Please do not just point me to another article or site.  I'm looking for a definitive answer - one that works.
0
HLRosenberger
Asked:
HLRosenberger
  • 2
1 Solution
 
Kyle AbrahamsSenior .Net DeveloperCommented:
http://stackoverflow.com/questions/10765149/disabled-works-in-ie-but-not-in-firefox

The link explains that IE grays out the button while firefox does not, however it is disbaled.
Have you tried clicking on the button in firefox?

The solution proposed in that site is to use a different image to imitate the grayed out button.
0
 
HLRosenbergerAuthor Commented:
Yes, I already saw this article.  I wish it was truely disabled, but just not grayed out.
0
 
COBOLdinosaurCommented:
if you are using an xhtml doctype then the correct reference is:

btn.disabled = 'disabled';

Cd&
0
 
HLRosenbergerAuthor Commented:
Yes, this worked.  I used a new CSS class to gray out the button.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now