Changeset 63 in text-formbuilder for trunk/lib/Text/FormBuilder.pm


Ignore:
Timestamp:
02/18/05 11:26:45 (19 years ago)
Author:
peichman
Message:

field groups can be directly named as the type in a fieldspec

File:
1 edited

Legend:

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

    r61 r63  
    99$VERSION = '0.09_02'; 
    1010@EXPORT = qw(create_form); 
     11 
     12#$::RD_TRACE = 1; 
    1113 
    1214use Carp; 
     
    1719my %DEFAULT_OPTIONS = ( 
    1820    method => 'GET', 
    19 ##     javascript => 1, 
    2021    keepextras => 1, 
    2122); 
     
    226227    } 
    227228     
    228     # use the list for displaying checkbox groups 
     229    # use columns for displaying checkbox fields larger than 2 items 
    229230    foreach (@{ $self->{form_spec}{fields} }) { 
    230231        if (ref $$_{options} and @{ $$_{options} } >= 3) { 
     
    535536                $OUT .= qq[    <td><span class="fieldgroup">]; 
    536537                $OUT .= join(' ', map { qq[<small class="sublabel">$$_{label}</small> $$_{field} $$_{comment}] } @group_fields); 
    537                 $OUT .= " ] . $msg_invalid . q[" if $$_{invalid}; 
     538                #TODO: allow comments on field groups 
     539                $OUT .= " ] . $msg_invalid . q[" if grep { $$_{invalid} } @group_fields; 
    538540                 
    539541                $OUT .= qq[    </span></td>\n]; 
     
    11621164C<birthday_day>, and C<birthday_year>. 
    11631165 
     1166You can also use groups in normal field lines: 
     1167     
     1168    birthday|Your birthday:DATE 
     1169 
     1170The only (currently) supported pieces of a fieldspec that may be used with a 
     1171group in this notation are name and label. 
     1172 
    11641173=head2 Comments 
    11651174 
     
    11751184reset button 
    11761185 
    1177 Allow groups to be used in normal field lines something like this: 
    1178  
    1179     !group DATE { 
    1180         month 
    1181         day 
    1182         year 
    1183     } 
    1184      
    1185     dob|Your birthday:DATE 
     1186Allow comments on group fields (rendered after the all the fields) 
    11861187 
    11871188Pieces that wouldn't make sense in a group field: size, row/col, options, 
Note: See TracChangeset for help on using the changeset viewer.