I wrote some code which allows me to disable/enable checkboxes when I right-click them. It works in IE but not in Chrome or Firefox.
rightClickFunc: function (e)
{
var obj;
if ($.browser.msie) obj = event.srcElement;
else obj = e.target;
stuff.disableEnableObject(obj);
return false;
},
disableEnableObject: function (o)
{
if (o.getAttribute("disabled") == null)
$('#'+o.id).attr("disabled", "disabled");
else $('#'+o.id).removeAttr("disabled");
}
How can I get the same functionality in Chrome as IE? The problem seems to be that right clicking on a disabled item in chrome does open the context menu (right click menu).
I made a sample of the code - see http://jsfiddle.net/e72M6/. Run it in IE and chrome to see the difference. (IE can enable the boxes, Chrome cannot).
I want the other browser to have the same functionally as IE. So the boxes can be enabled.