/*
#########################################
Script para validar formularios
Fecha: 25/08/2005
Autor: Genner Puello
Copyright 2005 dsldatasolutions.net
#########################################
*/

/* Agregar esta linea: <form action="script.php,asp,.." onSubmit="return validar()">
Donde : validar(), es la funcion a continuacion.
*/

// Funcion validar(), es la funcion principal.

// Nombre de la forma: miforma

function validar()
{
    // TEXTBOX - TEXTAREAS - HIDDENS//////////////////
    // Agregar las validaciones de campos de texto aqui.
    // Por cada campo es un "else if"
    
	if (document.miforma.nombre.value=='')
	{
       	  alert('Debe digitar el nombre.');
		  document.miforma.nombre.focus();
		  document.miforma.Submit.value='Enviar';
		  return false;

	}
	if (document.miforma.ciudad.value=='')
	{
		alert('Debe digitar la ciudad');
		document.miforma.ciudad.focus();
		document.miforma.Submit.value='Enviar';
		return false;
	}
	if (document.miforma.direccion.value=='')
	{
		alert('Debe digitar la direccion');
		document.miforma.direccion.focus();
		document.miforma.Submit.value='Enviar';
		return false;
	}
	if (document.miforma.telefono.value=='')
	{
		alert('Debe digitar el telefono.');
		document.miforma.telefono.focus();
		document.miforma.Submit.value='Enviar';
		return false;
	}
	if (document.miforma.email.value=='')
	{
		alert('Debe digitar la direccion de correo.');
		document.miforma.email.focus();
		document.miforma.Submit.value='Enviar';
		return false;
	}
    
	// SELECT BOXES
	
	//document.miforma.pais.options
    //[document.miforma.pais.selectedIndex].value
    
    // CHECKBOXES
    
    /*
       if (!document.miforma.recordar.checked) {
	       // No esta marcado
	       alert('Debe marcar recordar');
	       return false;
       }
    
    */
    // RADIO BOTTOM
    /*
    if (!document.feedback.field[0].checked &&
         !document.feedback.field[1].checked &&
         !document.feedback.field[2].checked) {
	     // no radio button is selected
	     return false;
     }*/
     
     // EMAIL
     
       

	return true;
}
