
11/03/2004, 10:35
|
 | Colaborador | | Fecha de Ingreso: marzo-2004 Ubicación: En alguna otra parte
Mensajes: 4.656
Antigüedad: 21 años Puntos: 63 | |
Muy buenas
;)
Bueno, esta es una forma rápida pero te puede resultar efectiva, te pego el código de ejemplo
<html>
<head>
<title>pruebilla</title>
<script type="text/javascript">
function validar() {
var a = document.forms[0].elements[0].value;
a1 = a.indexOf('.gif');
a2 = a.indexOf('.jpg');
if ((a1 > 0) || (a2 >0)) {
alert("imagen válida");
} else {
alert("imagen no valida");
}
}
</script>
</head>
<body>
<form>
<input type="text" id="hola" value=" " onchange="javascript:validar(this)">
</form>
</body>
</html>
__________________ ¡ hey, hou, hou, hey ! |