118
rated 0 times
[
121]
[
3]
/ answers: 1 / hits: 110704
/ 12 Years ago, mon, october 15, 2012, 12:00:00
I'm starting with Javascript, I wrote this function:
function disableField() {
if( document.getElementById(valorFinal).length > 0 ) ) {
document.getElementById(cantidadCopias).disabled = true;
}
}
Which disables the second field named cantidadCopias if the first one is filled.
<label> <span>Valor final:</span>
<input type=text class=input_text name=valorFinal id=valorFinal onkeydown=disableField()/>
</label>
<label> <span>Cantidad de Copias:</span>
<input type=text class=input_text name=cantidadCopias id=cantidadCopias/>
</label>
But it's not disabling the second field when the first one is filled.
More From » html