0

I'm trying to disable an input with JavaScript or jQuery

//document.getElementById("monto").disabled=true;
$(document).ready(function(){
    $("#monto").attr("disabled", "disabled");
});

The code works fine in chrome, Firefox, and some versions of IE, but doesn't work with IE 8, also tried with Hide/show but doesn't work too.

I know the best solution is to upgrade, but my boss thinks our clients are too dumb to do that.

j08691
  • 204,283
  • 31
  • 260
  • 272
zickno
  • 115
  • 1
  • 3
  • 10

1 Answers1

1

try this article from stackoverflow :)

var disableSelection = function(){
    $("#elementId").prop("disabled", true);    
};

var enableSelection = function(){
    $("#elementId").prop("disabled", false);
};
Community
  • 1
  • 1
S. Ferit Arslan
  • 199
  • 3
  • 8