<html>
<head>
<title> Submit07 </title>
<script language="javascript">
function enviar()
{
validos = "abcdefghijklmnopqrstuvwxyz0123456789"
campo = document.getElementById("dato1")
texto = campo.value;
n = texto.length;
for (i = 0; i< n; i++) {
c = texto.charAt(i);
if (validos.indexOf(c) == -1) {
alert("Incorrecto: solamente se aceptan minúsculas y dígitos!");
campo.focus();
campo.select();
return;
}
}
document.formulario.submit()
}
</script>
</head>
<body>
<form name="formulario" target="_top" method="get">
<input id="dato1" type="text" name="dato" size="12" />
<br />
<input type="button" value="Enviar" onclick="enviar()" /></td>
</form>
</body>
</html>