1 ////////////////////////////////////////////////////////////////////////////////
4 // Revision: $Revision: 1.1 $
5 // Description: This JavaScript is included in the MAPS signup form to check
6 // 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 (signup) {
17 trim_trailing_spaces (userid);
19 if (userid.value == "") {
20 alert ("You must choose a name!");
25 if (userid.value.indexOf (" ") != -1) {
26 alert ("Userids cannot contain spaces");
31 trim_trailing_spaces (fullname);
33 if (fullname.value == "") {
34 alert ("Full name is required!");
39 if (email.value == "") {
40 alert ("We need your email address - in case you forget " +
41 "your password\nand we need to send it to you.");
45 var email_regex = /^\w+@\w+\.\w+$/;
47 if (!valid_email_address (email)) {
48 alert ("That email address is invalid!\n" +
49 "Must be <username>@<domainname>\n" +
50 "For example: Andrew@DeFaria.com.");
55 if (password.value == "") {
56 alert ("You need to specify a password!");
61 if (password.value.length < 6) {
62 alert ("Passwords must be greater than 6 characters.");
67 if (repeated_password.value == "") {
68 alert ("Please repeat your password.");
69 repeated_password.focus ();
73 if (repeated_password.value.length < 6) {
74 alert ("Passwords must be greater than 6 characters.");
75 repeated_password.focus ();
79 if (password.value != repeated_password.value) {
80 alert ("Sorry but the password and repeated password are not the same!");
85 if (MAPSPOP [0].checked) {
86 alert ("Sorry but MAPSPOP has not be implemented yet!");
90 if (tag_and_forward [0].checked) {
91 alert ("Sorry but Tag & Forward has not be implemented yet!");