/** * @Module : validate.js * @Purpose : Validation code * @Creation Date : 09/10/08 * @Author : Mobera Team * @Version : 1.0 * @Modified Date : 15/10/08 */ function download(form,exefile) { var i for(i = 1; i < form.length; i++) { if(form.elements[i].value.length <= 0) { alert("Please enter the verification code"); return false; } } return true; } function loginForm(form) { document.getElementById("validate0").innerHTML=""; document.getElementById("validate1").innerHTML=""; if(document.getElementById("login-name").value.length==0) { document.getElementById("validate0").innerHTML = "Please fill the Username."; return false; } if(document.getElementById("login-password").value.length==0) { document.getElementById("validate1").innerHTML = "Please fill the Password."; return false; } //if(login-name) return true; } function registration(form) { var i for(i = 1; i < form.length; i++) { if(form.elements[i].value.length <= 0) { if(i== 6) { continue; } alert("All the fields except zip code are mandatory"); return false; } if(form.elements[i].name == "usr") { var iChars = "!@#$%^&*(){}|[];:?<>"; var userValue = form.elements[i].value; if(userValue.length < 6) { alert("Username must be of 6 chars"); return false; } for(var k = 0; k < userValue.length; k++) { if(iChars.indexOf(userValue.charAt(k)) != -1) { alert("Only '_', '-', '.' special characters are allowed in the username."); return false; } if(' '.indexOf(userValue.charAt(k)) != -1) { alert("Spaces are not allowed in the username."); return false; } } } if(form.elements[i].name == "passwd") { if(form.elements[i].value.length < 6) { alert("Password must be of 6 characters"); return false; } } if(form.elements[i].name == "email") { var iChars = "!#$%^&*(){}|[];:?<>"; var emailValue = form.elements[i].value; for(var k = 0; k < emailValue.length; k++) { if(' '.indexOf(emailValue.charAt(k)) != -1) { alert("Spaces are not allowed in the email address."); return false; } if(iChars.indexOf(emailValue.charAt(k)) != -1) { alert("Only '_', '-', '.', '@' special characters are allowed in the email address."); return false; } } } } var password = form.passwd.value; var passwordConfirm = form.passconfirm.value; if(password != passwordConfirm) { alert("Password does not match"); return false; } var email = form.email.value; var atPosition = email.indexOf('@'); if(atPosition < 1) { alert("Please enter a valid email address"); return false; } var dotPosition = email.lastIndexOf('.'); if(dotPosition < 3) { alert("Please enter a valid email address"); return false; } if((email.length - dotPosition) > 5) { alert("Please enter a valid email address"); return false; } var iSpace = " "; for(var k = 0; k < email.length; k++) { if(iSpace.indexOf(email.charAt(k)) != -1) { alert("Please enter valid email address"); return false; } } var emailConfirm = form.emailconfirm.value; if(email != emailConfirm) { alert("Email addresses does not match"); return false; } if(document.getElementById("agreement").checked == false) { alert("Please agree to the Terms of Service"); return false; } return true; } function forgot(emailValue) { if(emailValue.length <= 0) { alert("Please enter the email address"); return false; } email = emailValue; var atPosition = email.indexOf('@'); if(atPosition < 1) { alert("Please enter a valid email address"); return false; } var dotPosition = email.lastIndexOf('.'); if(dotPosition < 3) { alert("Please enter a valid email address"); return false; } if((email.length - dotPosition) > 5) { alert("Please enter a valid email address"); return false; } var iSpace = " "; for(var k = 0; k < email.length; k++) { if(iSpace.indexOf(email.charAt(k)) != -1) { alert("Please enter valid email address"); return false; } } var iChars = "!#$%^&*(){}|[];:?<>"; for(var k = 0; k < emailValue.length; k++) { if(iChars.indexOf(emailValue.charAt(k)) != -1) { alert("Only '_', '-', '.', '@' special characters are allowed in the email address."); return false; } } return true; } function info() { alert("We consider all content uploaded to our servers the property ofthe person who uploaded it. Therefore, you should ONLY upload contentthat you have created, you own, you have a license from a third party toupload the specific content on the internet, or content that is in thepublic domain. This includes all elements contained in your content. You assume all risk and responsibility for determining whether the contentuploaded meets with the requirements.\r\n\r\nYou hereby grant us a limited, non-exclusive, perpetual, transferable, assignable, fully paid-up, royalty-free, worldwide license to encode, compress, convert,host, distribute, transfer, perform, reproduce, display, and otherwise exploit your content over the Site and to use such content foradvertisement purposes as we see fit, in any medium, in its sole and absolute discretion, without any compensation to you. Such license will apply to any form, media, or technology now known or hereafter developed. You represent and warrant that you are authorized to grant us all rights set forth in the preceding sentence. In order to revoke this license granted to us, simply remove your content."); }