Changeset 67 in text-formbuilder


Ignore:
Timestamp:
03/14/05 13:08:54 (20 years ago)
Author:
peichman
Message:

using <fieldset> instead of <h2> tags for dividing forms up into sections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Text/FormBuilder.pm

    r66 r67  
    2828#author, #footer { font-style: italic; } 
    2929caption h2 { padding: .125em .5em; background: #ccc; text-align: left; } 
     30fieldset { margin: 1em 0; } 
     31legend { font-size: 1.25em; font-weight: bold; background: #ccc; padding: .125em .25em; border: 1px solid #666; } 
    3032th { text-align: left; } 
    3133th h3 { padding: .125em .5em; background: #eee; } 
     
    492494<% 
    493495    SECTION: while (my $section = shift @sections) { 
     496        $OUT .= qq[<fieldset>\n]; 
     497        $OUT .= qq[  <legend>$$section{head}</legend>] if $$section{head}; 
    494498        $OUT .= qq[<table id="] . ($$section{id} || '_default') . qq[">\n]; 
    495         $OUT .= qq[  <caption><h2 class="sectionhead">$$section{head}</h2></caption>] if $$section{head}; 
     499        #$OUT .= qq[  <caption><h2 class="sectionhead">$$section{head}</h2></caption>] if $$section{head}; 
    496500        TABLE_LINE: for my $line (@{ $$section{lines} }) { 
    497501            if ($$line[0] eq 'head') { 
     
    542546        # close the table if there are sections remaining 
    543547        # but leave the last one open for the submit button 
    544         $OUT .= qq[</table>\n] if @sections; 
     548        if (@sections) { 
     549            $OUT .= qq[</table>\n]; 
     550            $OUT .= qq[</fieldset>\n]; 
     551        } 
    545552    } 
    546553%> 
     554  <tr><td colspan="2"><hr /></td></tr> 
    547555  <tr><th></th><td style="padding-top: 1em;"><% $submit %></td></tr> 
    548556</table> 
     557</fieldset> 
    549558<% $end %> 
    550559]; 
Note: See TracChangeset for help on using the changeset viewer.