Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/03/2015, 01:45
rsanjose
 
Fecha de Ingreso: marzo-2015
Ubicación: Sevilla
Mensajes: 2
Antigüedad: 9 años, 1 mes
Puntos: 0
Respuesta: Problemas con onBlur

Muchas gracias, creo que con tu ayuda ha quedado solucionado.

Os pego el código por si le ayuda a alguien:

Código:
<!DOCTYPE html>
<html>
<body>

<?php echo "<p>".$_GET['texto1']."-".$_GET['texto2']."</p>"; ?>
<form action="onblur.php">
Texto1: <input type="text" id="texto1" name="texto1" onkeypress="if (event.which == 13) {myProcessKey('texto1')};" onblur="myFunction('texto1');">
Texto2: <input type="text" id="texto2" name="texto2" onkeypress="if (event.which == 13) {myProcessKey('texto2')};" onblur="myFunction('texto2');">
<button type="submit">Ok</button>
</form>

<script>
function myProcessKey(field) {
	myFunction(field);
}

function myFunction(field) {
    x=document.getElementById(field);
    x.value = x.value.toUpperCase();
}
</script>

</body>
</html>
Saludos.
Rafa