Ver Mensaje Individual
  #4 (permalink)  
Antiguo 03/06/2008, 10:29
superPojo
 
Fecha de Ingreso: julio-2006
Ubicación: Argentina
Mensajes: 35
Antigüedad: 18 años, 6 meses
Puntos: 0
Respuesta: Programar el intro

Otra forma que la use mucho; fijate que la llamada le estas pasando el event y el id del siguiente campo de texto o lo que sea:


Código:
//Retorna true si la tecla presionada fue un ENTER
function isEnter(e) {
	var characterCode;
	try {
		if (e && e.which) {
			e = e;
			characterCode = e.which;
		} else {
			e = event;
			characterCode = e.keyCode;
		}
		if (characterCode == 13) {
			return true;
		} else {
			return false;
		}
	}
	catch (ex) {
		return false;
	}
}

function onEnterGo(e, idControl) {
	try {
		if (isEnter(e)) {
			document.getElementById(idControl).focus();
		}
	}catch (ex) {
		return false;
	}
}


<html:text property="importe" styleId="importe" size="15" maxlength="10" styleClass="text" tabindex="6" onkeypress="onEnterGo(event, 'codigoPrestador');"/>