Fixed the JavaScript in edit_web.js

This commit is contained in:
Alexey Verkhovsky 2005-02-10 21:55:13 +00:00
parent 8ab380d6dd
commit 533ef6a1cd

View file

@ -12,31 +12,28 @@ function checkSystemPassword(password) {
if (password == "") { if (password == "") {
alert("You must enter the system password"); alert("You must enter the system password");
return false; return false;
} else {
return true;
} }
} }
function validateEditWebForm() { function validateEditWebForm() {
if (!checkSystemPassword(document.getElementById('system_password').value)) {
if (!checkSystemPassword(document.getElementById('system_password').value)) return false;
return false }
end
if (document.getElementById('name').value == "") { if (document.getElementById('name').value == "") {
alert("You must pick a name for the web"); alert("You must pick a name for the web");
return false; return false;
} }
if (document.getElementById('address').value == "") { if (document.getElementById('address').value == "") {
alert("You must pick an address for the web"); alert("You must pick an address for the web");
return false; return false;
} }
if (document.getElementById('password').value != "" && if (document.getElementById('password').value != "" &&
document.getElementById('password').value != document.getElementById('password_check').value) { document.getElementById('password').value != document.getElementById('password_check').value) {
alert("The password and its verification doesn't match"); alert("The password and its verification doesn't match");
return false; return false;
} }
return true; return true;
} }