diff --git a/include/class.forms.php b/include/class.forms.php
index 646a98035cee622934e7258eb3f69d2fcd03ec29..e178444696cbd82bff4a0dbe52e62243559f938f 100644
--- a/include/class.forms.php
+++ b/include/class.forms.php
@@ -1794,7 +1794,7 @@ class PasswordWidget extends TextboxWidget {
         parent::parseValue();
         // Show empty box unless failed POST
         if ($_SERVER['REQUEST_METHOD'] != 'POST'
-                || $this->field->getForm()->isValid())
+                || !$this->field->getForm()->isValid())
             $this->value = '';
     }
 }