Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- msg= "";
- var counter=0;
- Firstname = document.rishum.Firstname.value;
- if (Firstname.length == 0)
- {
- msg = msg + "חסר שם פרטי \n";
- }
- for (i=0; i<Firstname.length; i++)
- {
- if (Firstname.charAt(i)<'a' || Firstname.charAt(i)>'z')
- {
- counter++;
- }
- }
- if(counter>0)
- msg=msg+"שם פרטי צריך לכלול רק אותיות \n";
- counter=0;
- Lastname = document.rishum.Lastname.value;
- if (Lastname.length == 0)
- {
- msg = msg + "חסר שם משפחה \n";
- }
- for (i=0; i<Lastname.length; i++)
- {
- if (Lastname.charAt(i)<'a' || Lastname.charAt(i)>'z')
- counter++;
- }
- if (counter>0)
- msg=msg+"שם משפחה צריך לכלול רק אותיות \n";
- counter=0;
- Username = document.rishum.Username.value;
- for (i=0; i<Username.length; i++)
- {
- if (Username.charAt(i)==' ')
- {
- counter++;
- }
- }
- if (counter>0)
- msg=msg+"שם משתמש לא יכול לכלול רווח \n";
- counter=0;
- Password = document.rishum.Password.value;
- ConfirmPassword = document.rishum.ConfirmPassword.value;
- if (Password.length<6)
- msg = msg + "סיסמה חייבת לכלול לפחות 6 תווים \n";
- if (Password != ConfirmPassword)
- msg = msg + "סיסמאות לא תואמות \n";
- Age = document.rishum.Age.value;
- for (i=0; i<Age.length; i++)
- {
- if (Age.charAt(i)<'0' || Age.charAt(i)>'9')
- counter++;
- }
- if(counter>0)
- msg=msg+"גיל צריך לכלול רק מספרים \n";
- counter=0;
- if (msg.length==0)
- return true;
- else
- alert("בטופס קיימות הבעיות הבאות:"+" "+ msg);
- return false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement