Initial commit
[clearscm.git] / maps / JavaScript / CheckRegistration.js
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File:        $RCSFile$
4 // Revision:    $Revision: 1.1 $
5 // Description: This JavaScript is included in the MAPS registration form
6 //              to 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
11 //
12 // (c) Copyright 2000-2006, Andrew@DeFaria.com, all rights reserved.
13 //
14 ////////////////////////////////////////////////////////////////////////////////
15 function validate (subscription) {
16   with (subscription) {
17     fullname = trim_trailing_spaces (fullname);
18
19     if (fullname.value == "") {
20       alert ("You must tell us your real name!");
21       fullname.focus ();
22       return false;
23     } // if
24
25     sender = trim_trailing_spaces (sender);
26
27     if (sender.value == "") {
28       alert ("We need your email address!");
29       sender.focus ();
30       return false;
31     } else {
32       if (!valid_email_address (sender)) {
33         alert ("That email address is invalid!\n"       +
34                "Must be <username>@<domainname>\n"      +
35                "For example: Andrew@DeFaria.com.");
36         return false;
37       } // if
38     } // if
39   } // with      
40
41   return true;
42 } // validate