Hola, tengo un script, que genera el dreamweaver, muchos la lo conoceran, lo que quiero hacer es agregarle una opcion que me verifique si un password ha sido verificado correctamente, el script es
Código:
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if(val.length<3){errors+='- '+nm+' debe contener al menos 3 caracteres.\n'};
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe ser una direccion de correo valida.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' debe ser un numero.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' debe ser un numero entre '+min+' y '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es necesario.\n'; }
} if (errors) alert('Se encontraron el(los) siguiente(s) error(es):\n'+errors);
document.MM_returnValue = (errors == '');
}
A este ya le habia agregado que me verifique que los campos tengan minimo 3 caracteres, la forma de llamarlos quizas tambien la conozcan pero la pongo:
En un boton pongo:
onClick="MM_validateForm('Usuario','','R','Passwor d','','R','Verifica_password','','R','Nombre','',' R','Email','','RisEmail','Telefono','','R','Invito ','','R');return document.MM_returnValue"
Quisiera poder agregar una opcion tipo 'Verifica_Password','','Rverif' y que cuando tenga la opcion Rverif se genere la verificacion de alguna manera, ojala alguien me pueda ayudar, de antemano muchas gracias