Project

General

Profile

1
function submitform(formObj) {
2

    
3
	if (trim(formObj.elements["loginAction"].value) != "Login")
4
		return true;
5
	// trim username & passwd:
6
	var username = trim(formObj.elements["uid"].value);
7
	var organization = trim(formObj.elements["organization"].value);
8
	var password = trim(formObj.elements["password"].value);
9

    
10
	if (username == "") {
11
		alert("You must type a username. \n" + popupMsg);
12
		formObj.elements["uid"].focus();
13
		return false;
14
	}
15

    
16
	if (organization == "") {
17
		alert("You must select an organization. \n" + popupMsg);
18
		formObj.elements["organization"].focus();
19
		return false;
20
	}
21

    
22
	if (password == "") {
23
		alert("You must type a password. \n" + popupMsg);
24
		formObj.elements["password"].focus();
25
		return false;
26
	}
27

    
28
	formObj.username.value = "uid=" + formObj.elements["uid"].value + ",o="
29
			+ formObj.elements["organization"].value
30
			+ ",dc=ecoinformatics,dc=org";
31
	return true;
32
}
33

    
34
function trim(stringToTrim) {
35
	return stringToTrim.replace(/^\s*/, '').replace(/\s*$/, '');
36
}
(9-9/10)