Index: trunk/lib/Text/FormBuilder.pm
===================================================================
--- trunk/lib/Text/FormBuilder.pm	(revision 14)
+++ trunk/lib/Text/FormBuilder.pm	(revision 15)
@@ -157,5 +157,5 @@
 use CGI::FormBuilder;
 
-sub form {
+sub get_form {
     my \$cgi = shift;
     my \$cgi_form = CGI::FormBuilder->new(
@@ -204,12 +204,17 @@
 
 sub _form_template {
-q[<p id="instructions">(Required fields are marked in <strong>bold</strong>.)</p>
+q[<% $description ? qq[<p id="description">$description</p>] : '' %>
+<% (grep { $_->{required} } @fields) ? qq[<p id="instructions">(Required fields are marked in <strong>bold</strong>.)</p>] : '' %>
 <% $start %>
 <table>
 <% my $i; foreach(@fields) {
     $OUT .= qq[  <tr><th class="sectionhead" colspan="2"><h2>$headings[$i]</h2></th></tr>\n] if $headings[$i];
-    $OUT .= qq[  <tr>];
+    $OUT .= $$_{invalid} ? qq[  <tr class="invalid">] : qq[  <tr>];
     $OUT .= '<th class="label">' . ($$_{required} ? qq[<strong class="required">$$_{label}:</strong>] : "$$_{label}:") . '</th>';
-    $OUT .= qq[<td>$$_{field} $$_{comment}</td></tr>\n];
+    if ($$_{invalid}) {
+        $OUT .= qq[<td>$$_{field} $$_{comment} Missing or invalid value.</td></tr>\n];
+    } else {
+        $OUT .= qq[<td>$$_{field} $$_{comment}</td></tr>\n];
+    }
     $i++;
 } %>
@@ -237,5 +242,4 @@
 <h1><% $title %></h1>
 <% $author ? qq[<p id="author">Created by $author</p>] : '' %>
-<% $description ? qq[<p id="description">$description</p>] : '' %>
 ] . $self->_form_template . q[
 <hr />
