Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function myFunction() {
- var msg = "";
- var userName = document.getElementById("TxtUserName").value;
- var name = document.getElementById("TxtName").value;
- var year = document.getElementById("year").value;
- var password = document.getElementById("Password1").value;
- var password2 = document.getElementById("Password2").value;
- if(userName.length<3)
- {
- msg+= "the user name must be 3 characters at least.\n";
- }
- if(password !=password2)
- {
- msg+="the passwords don't match.\n";
- }
- if (!password.includes(1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 0)) {
- msg += "There must be numbers in your password!"
- }
- if (!password2.includes(1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 0)) {
- msg += "There must be numbers in your password!"
- }
- if (name <= 2)
- {
- msg+="the name must be at lest 2 characters.\n"
- }
- if (name.includes(1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 0))
- {
- msg += "You must inculde only letters in your name!"
- }
- if ((year < 1998) || (year > 2003))
- {
- msg+="you can't get in.\n"
- }
- if (msg == "")
- {
- msg += "You're Welcome!"
- }
- alert(msg);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement