il focus lo fai con il document.getElementById.focus();
per gestirli puoi usare id simili... nel senso
codice:<input type="checkbox" ID="chk1" value="checkbox1" onclick="java-script:Garage(1);"> <input name="mqgarage" type="text" size="3" ID="txt1"></td> <input type="checkbox" ID="chk2" value="checkbox1" onclick="java-script:Garage(2);"> <input name="mqgarage" type="text" size="3" ID="txt2"></td> <input type="checkbox" ID="chk3" value="checkbox1" onclick="java-script:Garage(3);"> <input name="mqgarage" type="text" size="3" ID="txt3"></td> function Garage(x){ if(document.getElementById('chk'+x).checked){ document.getElementById('txt'+x).disabled=false; document.getElementById('txt'+x).focus(); } else { document.getElementById('txt'+x).disabled=true; } }

Rispondi quotando