Ver Mensaje Individual
  #12 (permalink)  
Antiguo 11/08/2008, 09:45
kvera
 
Fecha de Ingreso: julio-2008
Mensajes: 39
Antigüedad: 15 años, 9 meses
Puntos: 0
Respuesta: Validación Formulario

Cita:
<script LANGUAGE="JavaScript">

function Validar(form)
{
if (form.Nombre.value == "")
{ alert("Por favor ingrese su nombre"); form.Nombre.focus(); return; }

if (form.email.value == "")
{ alert("Por favor ingrese su dirección de e-mail"); form.email.focus(); return; }

if (form.telefono.value == "")
{ alert("Por favor ingrese su número de teléfono"); form.telefono.focus(); return; }

if (form.cantidad.value == "")
{ alert("Por favor ingrese la cantidad de entradas"); form.cantidad.focus(); return; }

if (form.ubicacion.value == "")
{ alert("Por favor ingrese ubicación"); form.ubicacion.focus(); return; }

if (form.edad.value == "")
{ alert("Por favor ingrese su edad"); form.edad.focus(); return; }

if (form.email.value.indexOf('@', 0) == -1 ||
form.email.value.indexOf('.', 0) == -1)
{ alert("Dirección de e-mail inválida"); form.email.focus(); return; }

//form.submit();
}

</script>
Este es el codigo de la segunda funcion....el form.submit lo tengo en comentario porque inicialmente el codigo funcionaba con un boton....pero no se porq nunca mas me funcionaon los botones....