1 ////////////////////////////////////////////////////////////////////////////////
4 // Revision: $Revision: 1.1 $
5 // Description: This JavaScript is included in the MAPS edit profile form to
6 // check the fields of the form.
7 // Author: Andrew@DeFaria.com
8 // Created: Fri Nov 29 14:17:21 2002
9 // Modified: $Date: 2013/06/12 14:05:47 $
10 // Language: JavaScript
12 // (c) Copyright 2000-2006, Andrew@DeFaria.com, all rights reserved.
14 ////////////////////////////////////////////////////////////////////////////////
15 function validate (profile) {
17 fullname = trim_trailing_spaces (fullname);
18 if (fullname.value == "") {
19 alert ("Full name is required!");
24 email = trim_trailing_spaces (email);
25 if (email.value == "") {
26 alert ("We need your email address - in case you forget your password\nand we need to send it to you.");
30 if (!valid_email_address (email)) {
31 alert ("That email address is invalid!\nMust be <username>@<domainname>\nFor example: Andrew@DeFaria.com.");
37 "To change your password specify both your old and new passwords then\n" +
38 "repeat your new password in the fields provided\n\n" +
39 "To leave your password unchanged leave old, new and repeated\n" +
40 "password fields blank";
42 if (old_password.value != "") {
43 if (new_password.value == "") {
45 new_password.focus ();
48 if (new_password.value.length < 6) {
49 alert ("Passwords must be greater than 6 characters.");
50 new_password.focus ();
54 if (repeated_password.value == "") {
56 repeated_password.focus ();
59 if (repeated_password.value.length < 6) {
60 alert ("Passwords must be greater than 6 characters.");
61 repeated_password.focus ();
65 if (new_password.value != repeated_password.value) {
66 alert ("Sorry but the new password and repeated password are not the same!");
67 new_password.focus ();
71 if (new_password.value != "") {
73 new_password.focus ();
76 if (repeated_password.value != "") {
78 repeated_password.focus ();
83 if (MAPSPOP [0].checked) {
84 alert ("Sorry but MAPSPOP has not yet been implemented");
88 if (tag_and_forward [0].checked) {
89 alert ("Sorry but Tag & Forward has not yet been implemented");