function validate_login_addedit(oForm) {

  var reSpace = new RegExp(' ', 'g');
  var sUsername = (new String(oForm.username.value)).replace(reSpace, '');
  var sPassword = (new String(oForm.password.value)).replace(reSpace, '');
  var sErrors = 'The following errors occurred:\n';

  var bSuccess = true;

  if (sUsername.length <= 0) {
    sErrors += '- The username is required.\n';
    bSuccess = false;
  }

  if (sPassword.length <= 0) {
    sErrors += '- A password is required.\n';
    bSuccess = false;

  }
  
 if (!bSuccess) {
    alert(sErrors);
  }

  return bSuccess;
}
