Dovrebbe andare bene così:
codice:
<SCRIPT >
//SCRIPT CHE ALLA PRESSIONE DI INVIO MI PASSA AL CAMPO SUCCESSIVO
nextfield = "datadocumento";
netscape = "";
ver = navigator.appVersion;
len = ver.length;
for( iln = 0; iln < len; iln++ ) {
if( ver.charAt( iln ) == "(" ) {
break;
}
}
netscape = ( ver.charAt( iln+1 ).toUpperCase() != "C" );
// handle the keypress
function keyDown( DnEvents ) {
// determine whether Netscape or Internet Explorer
k = ( netscape ) ? DnEvents.which : window.event.keyCode;
// enter key pressed
if ( k == 13 ) {
if ( nextfield == 'done' ) {
// submit, we finished all fields
return true;
} else {
// we are not done yet, send focus to next box
eval( 'document.data.' + nextfield + '.focus()' );
return false;
}
}
}
// work together to analyze keystrokes
document.onkeydown = keyDown;
if ( netscape ) {
document.captureEvents( Event.KEYDOWN|Event.KEYUP );
}
</SCRIPT>
da usare così
codice:
<input name="qta3" type="text" id="qta32" size="5" onFocus="nextfield='prezzo3'" >
<input name="prezzo3" type="text" id="prezzo3" size="20" onFocus="nextfield='rif3'" >