SOLUCIONADO ....
JAVASCRIPT
:
Código PHP:
function check(chkbox, n){
if(chkbox.checked == false){
document.getElementById('caja'+n).disabled = true;
document.getElementById('cantidad'+n).disabled = true;
document.getElementById('caja'+n).value = "";
document.getElementById('cantidad'+n).value = "";
document.getElementById('caja'+n).className = "disabled";
document.getElementById('cantidad'+n).className = "disabled";
} else {
document.getElementById('caja'+n).disabled = false;
document.getElementById('cantidad'+n).disabled = false;
document.getElementById('caja'+n).className = "enabled";
document.getElementById('cantidad'+n).className = "enabled";
document.getElementById('caja'+n).value = "Nro CAJA";
document.getElementById('cantidad'+n).value = "CANTIDAD";
chkbox.checked = true;
return false;
}
}
PHP:
Código PHP:
i=1;
<INPUT TYPE=CHECKBOX NAME="floor$i" onclick="check(this, $i)">Piso $i<br>
<INPUT TYPE=INPUT NAME="caja$i" ID="caja$i" class="disabled" disabled><br>
<INPUT TYPE=INPUT NAME="cantidad$i" ID="cantidad$i" class="disabled" disabled>
i++;
<INPUT TYPE=CHECKBOX NAME="floor$i" onclick="check(this, $i)">Piso $i<br>
<INPUT TYPE=INPUT NAME="caja$i" ID="caja$i" class="disabled" disabled><br>
<INPUT TYPE=INPUT NAME="cantidad$i" ID="cantidad$i" class="disabled" disabled>
i++;