validate password in prefs form

This commit is contained in:
Andrew Dolgov 2006-05-18 06:19:40 +01:00
parent e5d758e3db
commit 64dc59764a
2 changed files with 14 additions and 1 deletions

View File

@ -3183,7 +3183,7 @@
print "</form>";
print "<form action=\"backend.php\" method=\"POST\">";
print "<form action=\"backend.php\" method=\"POST\" name=\"changePassForm\">";
print "<table width=\"100%\" class=\"prefPrefsList\">";
print "<tr><td colspan='3'><h3>Authentication</h3></tr></td>";
@ -3202,6 +3202,7 @@
print "<input type=\"hidden\" name=\"op\" value=\"pref-prefs\">";
print "<p><input class=\"button\" type=\"submit\"
onclick=\"return validateNewPassword(this.form)\"
value=\"Change password\" name=\"subop\">";
print "</form>";

View File

@ -1448,3 +1448,15 @@ function browserToggleExpand(id) {
exception_error("browserExpand", e);
}
}
function validateNewPassword(form) {
if (form.OLD_PASSWORD.value == "") {
alert("Current password cannot be blank");
return false;
}
if (form.NEW_PASSWORD.value == "") {
alert("New password cannot be blank");
return false;
}
return true;
}