views:

1868

answers:

5

Why when I set enabled=false on a button does it not render correctly in Firefox? Instead of graying out the link it is still blue.

[UPDATE]

ASP.net already removes such tags on the link so the only thing that is needed is to grey out he link. In other words a CSS style change not a functionality change.

The following effectively resolved the disabled buttons not showing up as grayed out in firefox and google chrome. I put this into my style sheet and now all my link buttons render correctly.

a[disabled]{
color:Grey !important; text-decoration:none !important; }

+2  A: 

From W3Scholl, "Enabled" Property isn't standard property of XHTML 4(It's Microsoft standard.). You should remove href property from hyperlink or using my following code

// cancel click event.
LinkButton1.Attributes["OnClick"] = "return false;";
// set css to display same disabled link in all browser
LinkButton1.CssClass = "LinkButton_Disabled";
Soul_Master
+1  A: 

a[disabled]{ color:Grey; text-decoration:none; }

worked for me, Thank you...

Nikeeta Vanjara
A: 

Great answer middletone, helped me to avoid CSS work, now i can do it directly by ur way

Habuba
A: 

Are you using windows XP with the 'windows classic style'? Try 'windows xp style', with this style, the disabled/enabled button in firefox will be disinct.

A: 

The solution below is for buttons not link but it can be done for link as well.

var obj = document.getElementById('buttonId''); getLabel = function(elem){ if (elem.id && elem.id=="label") { elem.id = "disabledLabel"; } };
Dom.getElementsBy(getLabel ,'td', obj);

This will show button as disable or grayed out.

vsingh