NIHVIVO-1774: js change to allow deletes when there is no first/last names
This commit is contained in:
parent
f3484f0331
commit
03db8dae59
2 changed files with 22 additions and 7 deletions
|
@ -2,14 +2,24 @@
|
|||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
|
||||
var bypassValidateUF = false;
|
||||
|
||||
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;
|
||||
bypassValidateUF = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
function forceCancelTwo(theForm) { // called when there are no password fields displayed
|
||||
bypassValidateUF = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
function validateUserFields(theForm) {
|
||||
if ( bypassValidateUF ) {
|
||||
return true;
|
||||
}
|
||||
if (theForm.Username.value.length == 0 ) {
|
||||
alert("Please enter a valid Email address.");
|
||||
theForm.Username.focus();
|
||||
|
@ -32,10 +42,8 @@
|
|||
|
||||
function validatePw(theForm) {
|
||||
|
||||
if ( theForm.Md5password.value != "CANCEL") {
|
||||
if ( !validateUserFields(theForm) ) {
|
||||
if ( !validateUserFields(theForm) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (theForm.Md5password.value.length == 0 ) {
|
||||
alert("Please enter a password.");
|
||||
|
@ -58,8 +66,14 @@
|
|||
}
|
||||
|
||||
function confirmDelete() {
|
||||
bypassValidateUF = true;
|
||||
var msg="Are you SURE you want to delete this user? If in doubt, CANCEL."
|
||||
return confirm(msg);
|
||||
var answer = confirm(msg)
|
||||
if ( answer )
|
||||
return true;
|
||||
else
|
||||
bypassValidateUF = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
-->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue