Admin
 
 
Logo DIPLOX
Convertir un campo de texto a mayúsculas
Volver Por face
  
Jueves, 06/08/2009
Sencillo script para cambiar a mayúsculas el contenido de un campo input text de un formulario. El cambio se produce al abandonar el campo.

<html>
<head>
<title>Text Object DefaultValue</title>
<script language=¨¨=¨JavaScript¨>
function conMayusculas (field) {
field.value = field.value.toUpperCase ()
}
</script>
</head>
<body>
<form>
Al salir del campo convierte en mayúsculas:<br />
<label>Nombre:</label><input input=¨text¨ name=¨nombre¨ value=¨¨ onChange=¨conMayusculas (this)¨><br />
<label>Nombre:</label><input type=¨text¨ name=¨apellidos¨ value=¨¨ ><br />
</form>
</body>
</html>


Volver Por face