- Timestamp:
- 11/02/04 10:09:45 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Text/FormBuilder.pm
r14 r15 157 157 use CGI::FormBuilder; 158 158 159 sub form {159 sub get_form { 160 160 my \$cgi = shift; 161 161 my \$cgi_form = CGI::FormBuilder->new( … … 204 204 205 205 sub _form_template { 206 q[<p id="instructions">(Required fields are marked in <strong>bold</strong>.)</p> 206 q[<% $description ? qq[<p id="description">$description</p>] : '' %> 207 <% (grep { $_->{required} } @fields) ? qq[<p id="instructions">(Required fields are marked in <strong>bold</strong>.)</p>] : '' %> 207 208 <% $start %> 208 209 <table> 209 210 <% my $i; foreach(@fields) { 210 211 $OUT .= qq[ <tr><th class="sectionhead" colspan="2"><h2>$headings[$i]</h2></th></tr>\n] if $headings[$i]; 211 $OUT .= qq[ <tr>];212 $OUT .= $$_{invalid} ? qq[ <tr class="invalid">] : qq[ <tr>]; 212 213 $OUT .= '<th class="label">' . ($$_{required} ? qq[<strong class="required">$$_{label}:</strong>] : "$$_{label}:") . '</th>'; 213 $OUT .= qq[<td>$$_{field} $$_{comment}</td></tr>\n]; 214 if ($$_{invalid}) { 215 $OUT .= qq[<td>$$_{field} $$_{comment} Missing or invalid value.</td></tr>\n]; 216 } else { 217 $OUT .= qq[<td>$$_{field} $$_{comment}</td></tr>\n]; 218 } 214 219 $i++; 215 220 } %> … … 237 242 <h1><% $title %></h1> 238 243 <% $author ? qq[<p id="author">Created by $author</p>] : '' %> 239 <% $description ? qq[<p id="description">$description</p>] : '' %>240 244 ] . $self->_form_template . q[ 241 245 <hr />
Note: See TracChangeset
for help on using the changeset viewer.