home *** CD-ROM | disk | FTP | other *** search
- <@INCLUDE <@VAR uUnivFolderPath>Scripts/CheckEmail.txt>
-
- function checkPassword(checkString , testLen)
- {
- if ( (checkString.length == 0) && (testLen == 1) )
- return false;
-
- // CHECK STRING
- for (var i = 0; i < checkString.length; i++) {
- ch = checkString.substring(i, i + 1)
- if ( !((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z")
- || (ch == "@") || (ch == ".") || (ch == "_")
- || (ch == "-") || (ch >= "0" && ch <= "9")) )
- return false;
- }
- return true;
- } // checkPassword()
-
- function CheckLoginVals( FormNo )
- {
-
-
- <@IF "<@LOCATE 'ChangePayMethodPrecheckout' <@VAR uPage>> > 0">
- if ( document.forms[FormNo].CardType.selectedIndex == 0 ) { // No payment type selected
- alert( "Select payment method.");
- return false;
- }
- </@IF>
-
-
- <@IF "<@VAR uPage>!='ChangePayMethod'">
- if ( document.forms[FormNo].PasswordOption[3].checked == false ) // only proceed with validation if returning customer
- return true;
-
-
- if ( !checkEmail(document.forms[FormNo].EmailAddress.value) ) {
- alert("Invalid E-Mail address");
- document.forms[FormNo].EmailAddress.focus();
- document.forms[FormNo].EmailAddress.select();
- return false;
- }
-
- if ( !checkPassword(document.forms[FormNo].Password.value , 1) ) {
- alert("Invalid password");
- document.forms[FormNo].Password.focus();
- document.forms[FormNo].Password.select();
- return false;
- }
- </@IF>
-
- return true;
- } // CheckLoginVals()
-
-
-