Index: trunk/lib/Text/FormBuilder.pm
===================================================================
--- trunk/lib/Text/FormBuilder.pm	(revision 62)
+++ trunk/lib/Text/FormBuilder.pm	(revision 63)
@@ -9,4 +9,6 @@
 $VERSION = '0.09_02';
 @EXPORT = qw(create_form);
+
+#$::RD_TRACE = 1;
 
 use Carp;
@@ -17,5 +19,4 @@
 my %DEFAULT_OPTIONS = (
     method => 'GET',
-##     javascript => 1,
     keepextras => 1,
 );
@@ -226,5 +227,5 @@
     }
     
-    # use the list for displaying checkbox groups
+    # use columns for displaying checkbox fields larger than 2 items
     foreach (@{ $self->{form_spec}{fields} }) {
         if (ref $$_{options} and @{ $$_{options} } >= 3) {
@@ -535,5 +536,6 @@
                 $OUT .= qq[    <td><span class="fieldgroup">];
                 $OUT .= join(' ', map { qq[<small class="sublabel">$$_{label}</small> $$_{field} $$_{comment}] } @group_fields);
-                $OUT .= " ] . $msg_invalid . q[" if $$_{invalid};
+                #TODO: allow comments on field groups
+                $OUT .= " ] . $msg_invalid . q[" if grep { $$_{invalid} } @group_fields;
                 
                 $OUT .= qq[    </span></td>\n];
@@ -1162,4 +1164,11 @@
 C<birthday_day>, and C<birthday_year>.
 
+You can also use groups in normal field lines:
+    
+    birthday|Your birthday:DATE
+
+The only (currently) supported pieces of a fieldspec that may be used with a
+group in this notation are name and label.
+
 =head2 Comments
 
@@ -1175,13 +1184,5 @@
 reset button
 
-Allow groups to be used in normal field lines something like this:
-
-    !group DATE {
-        month
-        day
-        year
-    }
-    
-    dob|Your birthday:DATE
+Allow comments on group fields (rendered after the all the fields)
 
 Pieces that wouldn't make sense in a group field: size, row/col, options,
Index: trunk/lib/Text/FormBuilder/grammar
===================================================================
--- trunk/lib/Text/FormBuilder/grammar	(revision 62)
+++ trunk/lib/Text/FormBuilder/grammar	(revision 63)
@@ -104,5 +104,5 @@
 
 field_line: <skip:'[ \t]*'> ( field | comment | blank ) "\n"
-line: <skip:'[ \t]*'> ( title | author | pattern_def | section_head | heading | group_field | unknown_directive | field | comment | blank ) "\n"
+line: <skip:'[ \t]*'> ( title | author | pattern_def | section_head | heading | group_field | field_group | unknown_directive | field | comment | blank ) "\n"
 
 title: '!title' /.*/
@@ -151,4 +151,12 @@
 group_name: /%[A-Z_]+/
 
+field_group: name label(?) group_type
+    { 
+	#warn "[$thisline] field $item{name} is $item{group_type}\n";
+	push @lines, [ 'group', { name => $item{name}, label => $item{'label(?)'}[0], group => $item{group_type} } ];
+    }
+
+group_type: ':' var_name
+
 field: name field_size(?) growable(?) label(?) hint(?) type(?) default(?) option_list(?) validate(?)
     {
@@ -160,6 +168,6 @@
 	    type     => $item{'type(?)'}[0],
 	    value    => $item{'default(?)'}[0],
-            list     => $list_var,
-            validate => $item{'validate(?)'}[0],
+	    list     => $list_var,
+	    validate => $item{'validate(?)'}[0],
 	    required => $required || 0,
 	};
@@ -187,5 +195,5 @@
 	$maxlength = undef;
 	@options = ();
-        
+	
 	$field;
     }
@@ -211,6 +219,5 @@
 hint: '[' /[^\]]+/ ']'    { $item[2] }
 
-# TODO: differentiate between builtins and custom field groups
-type: ':' ( builtin_field | var_name { warn "[Text::FormBuilder] Using field group names directly is not (yet) supported (input line $thisline)\n"; 'text' } )
+type: ':' builtin_field
 
 builtin_field: /textarea|text|password|file|checkbox|radio|select|hidden|static/
