more Widget updates. this breaks old-style templates, also changed how VPs behave...
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Field / Boolean.pm
index 764b7e0..c6afaff 100644 (file)
@@ -14,10 +14,16 @@ class Boolean is 'Reaction::UI::Widget::Field', which {
 
 =for layout field
 
+[%
+   IF content;
+    checked = 'checked="checked"';
+   ELSE;
+    checked = "";
+   END;
+%]
+
 <!-- We need a replacement for process_attrs -->
-<input type="checkbox" name="[% name %]" id="[% id %]" />
-  [% content | html %]
-</textarea>
+<input type="checkbox" id="[% id | html %]" name="[% name | html %]" value="1" [% checked %] />
 
 =for layout label