diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php
index 7786b5941e..9d06ba23c9 100644
--- a/lib/htmloutputter.php
+++ b/lib/htmloutputter.php
@@ -176,7 +176,7 @@ class HTMLOutputter extends XMLOutputter
$attrs = array('name' => $id,
'type' => 'text',
'id' => $id);
- if ($value) {
+ if (!is_null($value)) { // value can be 0 or ''
$attrs['value'] = $value;
}
$this->element('input', $attrs);