2010-01-29 22:13:57 +00:00
|
|
|
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
|
|
|
|
|
|
|
|
<script language="JavaScript" type="text/javascript">
|
|
|
|
<!--
|
2011-01-17 22:04:07 +00:00
|
|
|
var bypassValidateUF = false;
|
|
|
|
|
2010-01-29 22:13:57 +00:00
|
|
|
function forceCancel(theForm) { // we don't want validation to stop us if we're canceling
|
|
|
|
theForm.Md5password.value = "CANCEL"; // a dummy string to force validation to succeed
|
|
|
|
theForm.passwordConfirmation.value = theForm.Md5password.value;
|
2011-01-17 22:04:07 +00:00
|
|
|
bypassValidateUF = true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
function forceCancelTwo(theForm) { // called when there are no password fields displayed
|
|
|
|
bypassValidateUF = true;
|
2010-01-29 22:13:57 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-01-14 18:55:35 +00:00
|
|
|
function validateUserFields(theForm) {
|
2011-01-17 22:04:07 +00:00
|
|
|
if ( bypassValidateUF ) {
|
|
|
|
return true;
|
|
|
|
}
|
2011-01-10 17:54:23 +00:00
|
|
|
if (theForm.Username.value.length == 0 ) {
|
|
|
|
alert("Please enter a valid Email address.");
|
|
|
|
theForm.Username.focus();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (theForm.FirstName.value.length == 0 ) {
|
|
|
|
alert("Please enter a First Name.");
|
|
|
|
theForm.FirstName.focus();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (theForm.LastName.value.length == 0 ) {
|
|
|
|
alert("Please enter a Last Name.");
|
|
|
|
theForm.LastName.focus();
|
|
|
|
return false;
|
2011-01-14 18:55:35 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function validatePw(theForm) {
|
|
|
|
|
2011-01-17 22:04:07 +00:00
|
|
|
if ( !validateUserFields(theForm) ) {
|
2011-01-14 19:08:48 +00:00
|
|
|
return false;
|
2011-01-10 17:54:23 +00:00
|
|
|
}
|
|
|
|
if (theForm.Md5password.value.length == 0 ) {
|
|
|
|
alert("Please enter a password.");
|
|
|
|
theForm.Md5password.focus();
|
|
|
|
return false;
|
|
|
|
}
|
2010-01-29 22:13:57 +00:00
|
|
|
if (theForm.Md5password.value != theForm.passwordConfirmation.value) {
|
|
|
|
alert("The passwords do not match.");
|
|
|
|
theForm.Md5password.focus();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (theForm.Md5password.value.length < 6 || theForm.Md5password.value.length > 12) {
|
|
|
|
alert("Please enter a password between 6 and 12 characters long.");
|
|
|
|
theForm.Md5password.focus();
|
|
|
|
return false;
|
2011-01-10 17:54:23 +00:00
|
|
|
}
|
2011-01-14 18:55:35 +00:00
|
|
|
else {
|
2010-01-29 22:13:57 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function confirmDelete() {
|
2011-01-17 22:04:07 +00:00
|
|
|
bypassValidateUF = true;
|
2010-01-29 22:13:57 +00:00
|
|
|
var msg="Are you SURE you want to delete this user? If in doubt, CANCEL."
|
2011-01-17 22:04:07 +00:00
|
|
|
var answer = confirm(msg)
|
|
|
|
if ( answer )
|
|
|
|
return true;
|
|
|
|
else
|
|
|
|
bypassValidateUF = false;
|
|
|
|
return false;
|
2010-01-29 22:13:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
-->
|
|
|
|
</script>
|