function checkrequired(formulario) { //if (document.images) { for (i=0;i 0) { if (((tempobj.type=="text")||(tempobj.type=="textarea")||(tempobj.type=="password")||(tempobj.type=="file"))&&(valor.length==0)&&(nombre_campo.length >0)){ alert("Por favor introduzca "+nombre_campo+"."); //tempobj.style.background = "#CCCCCC"; //permitir cambiar el color de fondo del campo tempobj.focus(); return false; } if ((tipo.length > 0)&&(valor.length > 0)) { switch (tipo){ case "num": if (isNaN(valor)) { alert("El campo: "+nombre_campo+" debe ser numérico"); tempobj.select(); return false; } break; case "@@@": var inicio = valor.indexOf("@"); var fin = valor.lastIndexOf("@"); if ((inicio != fin) || ((inicio == -1) && (fin == -1)) || ((inicio == 0) && (fin == 0))|| ((inicio == valor.length-1) && (fin == valor.length-1))){ alert("Por favor, revise el campo "+nombre_campo+", no es una direccion de correo."); tempobj.select(); return false; } break; } } } } //} //fin document.images return true; }