/ Published in: JavaScript

Función para bloquear todos los inputs de la página en un determinado momento
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function bloqueaInputs() { var aqEstado = rtrim(document.Cliente.AQESTADO.value); if(aqEstado == "X") { var formCliente = document.getElementById("Cliente"); //--> donde Cliente es es form Elementos = document.getElementsByTagName("input"); //--> donde Elementos es un array que lo declaramos asà directamente //--> donde input son el tipo de elementos de la página que queremos deshabilitar var i=0; for(i=0; i<Elementos.length; i++) { Elementos[i].disabled = true; //--> recorremos el array y vamos deshabilitando los input } } }
Comments
