Chodzi mi o to ze chcialbym zeby po wpisaniu dwoch znakow godziny kursor automatycznie przeszedl do kolejnego komponentu
Nie bardzo mam pomysł jak to zrobic wiec prosze o pomoc
Z góry dzieki

<script> function changeFocus(){ maxlen=document.forms[0].godz.getAttribute('maxlength'); actual=document.forms[0].godz.value.length; if (actual==maxlen){ document.forms[0].min.focus(); } else {return;} }<!----> </script> <form> <input type="text" name="godz" maxlength="2" onKeyUp='changeFocus();'> <input type="text" name="min"> </form>
<script> function changeFocus(nazwa, nazwa_next){ maxlen=document.forms[0].nazwa.getAttribute('maxlength'); actual=document.forms[0].nazwa.value.length; if (actual==maxlen){ document.forms[0].nazwa next.focus(); } else {return;} }<!----> </script> <form> <input type="text" name="godz" maxlength="2" onKeyUp='changeFocus('godz', 'min');'> <input type="text" name="min" onKeyUp='changeFocus('min', '...');'> ... </form>
<script> function changeFocus(curr, nexty) { var inputs=new Array(); inputs[1]='min'; inputs[2]='sec'; maxlen=document.forms[0][curr].getAttribute('maxlength'); actual=document.forms[0][curr].value.length; if (actual==maxlen){ document.forms[0][inputs[nexty]].focus(); } else {return;} } <input type="text" name="godz" maxlength="2" size="2" onKeyUp='changeFocus(this.name, 1)'> <input type="text" name="min" maxlength="2" size="2" onKeyUp='changeFocus(this.name, 2)'> <input type="text" name="sec">
maxlen=document.forms[0][curr].getAttribute('maxlength');
document.forms[0][nexty].focus();
<script> function oblicz() { wartosc=document.getElementById('a1').value+document.getElementById('a4').value+document.getElementById('a3').value return wartosc } </script <input type="text" name="a1" > <input type="text" name="a2" > <input type="text" name="a3" > <input type="text" name="a4" disabled="tak" onClick=oblicz(); >