xaxex34 Geliştirici
Mesaj Sayısı : 323 Paylaşım Gücü : 880 Rep Point : 3 Kayıt tarihi : 07/08/10 Yaş : 28
| Konu: Parola Dogrulama Cuma Ağus. 27, 2010 7:01 am | |
| - Kod:
-
var fObjPassword = new Object(); var fObjConfirm = new Object(); fObjPassword = window.document.getElementById("txtPassword"); fObjConfirm = window.document.getElementById("txtConfirm"); if(ValidatePassword(fObjPassword,fObjConfirm) == true) { return true; }else{ return false; }//end if
}//end ValidateForm() function ValidatePassword(Password,PasswordConfirm) { var bolIsError = new Boolean(false); var strErrorMsg = new String(""); var objError = new Object(); if((CheckForEmpty(Password.value) == true)) { bolIsError = true; strErrorMsg = "ERROR: Password is blank. You must type a valid password."; objError = Password; }else if((CheckForEmpty(PasswordConfirm.value))){ bolIsError = true; strErrorMsg = "ERROR: Confirm field is blank. You must confirm your password."; objError = PasswordConfirm; }else if((Password.value)!=(PasswordConfirm.value)){ bolIsError = true; strErrorMsg = "ERROR: Password and confirm field do not match. They must match."; objError = Password; }else if(InvalidLength(Password.value,7,11)){ bolIsError = true; strErrorMsg = "ERROR: Password must be between 7 and 11 characters long."; objError = Password; }else if(InvalidChars(Password.value)){ bolIsError = true; strErrorMsg = "ERROR: Your password contains illegal characters. Please use "; strErrorMsg += "ONLY UPPERCASE LETTERS, lowercase letters or digits (0-9)."; objError = Password; }else if(MeetMinReqs(Password.value)){ bolIsError = true; strErrorMsg = "ERROR: Your password MUST contain AT LEAST ONE UPPERCASE LETTER, "; strErrorMsg += "AT LEAST ONE lowercase letter and AT LEAST ONE digit."; objError = Password; }//end if if(bolIsError == true) { window.alert(strErrorMsg); objError.select(); return false; }else{ return true; }//end if }//end ValidatePassword
[img]http://forum.ceviz.net/images/misc/progress.gif[/img]
| |
|
sadasdg Geliştirici
Mesaj Sayısı : 440 Paylaşım Gücü : 702 Rep Point : 4 Kayıt tarihi : 23/06/10 Yaş : 26
| Konu: Geri: Parola Dogrulama Cuma Ağus. 27, 2010 12:11 pm | |
| | |
|