0

enabled the commandbutton when the user first filtered in the datatable and disabled commandbutton when the user no filtered in the datatable.

I try to solve it with javascript but I found solutions in an input when writing but I found no solution when filtered.

<script type="text/javascript"> function txtkeypress(){ 
  var val1=document.getElementById("prueba").value; 
  var boton = document.getElementById("InsertarAdmitidos"); 
  if(val1=="") boton.setAttribute("disabled","disabled"); 
  else boton.removeAttribute('disabled') 
} </script>
eebbesen
  • 4,760
  • 7
  • 46
  • 67
user3294707
  • 23
  • 1
  • 6
  • Please show code you've tried so far. – eebbesen Feb 10 '14 at 21:42
  • Take a look at [this question and answer](http://stackoverflow.com/questions/3014649/how-to-disable-html-button-using-javascript). I'm also not clear exactly what isn't working, but I'm assuming that your button is not disabling, so try `boton.setAttribute("disabled", "true");` – eebbesen Feb 10 '14 at 22:26

0 Answers0