Changeset 61 in text-formbuilder


Ignore:
Timestamp:
02/10/05 16:52:01 (19 years ago)
Author:
peichman
Message:

added growable field support (release pending release of FB 3.002)
upped FB required version to 3.001
added a belated thank you to Nate

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.PL

    r55 r61  
    77##     EXE_FILES         => [ 'bin/fb.pl' ], 
    88    PREREQ_PM         => {  
    9                             CGI::FormBuilder => 2.13, 
     9                            CGI::FormBuilder => 3.001, 
    1010                            Parse::RecDescent => 1.94, 
    1111                            Text::Template => 1.44, 
  • trunk/lib/Text/FormBuilder.pm

    r60 r61  
    1717my %DEFAULT_OPTIONS = ( 
    1818    method => 'GET', 
    19     javascript => 0, 
     19##     javascript => 1, 
    2020    keepextras => 1, 
    2121); 
     
    231231            $$_{columns} = int(@{ $$_{options} } / 8) + 1; 
    232232        } 
    233         #$$_{ulist} = 1 if ref $$_{options} and @{ $$_{options} } >= 3; 
    234233    } 
    235234     
     
    10531052 
    10541053This currently only works for single line text fields. 
    1055      
     1054 
     1055To create a growable field, add a C<*> after the name (and size, if 
     1056given). Growable fields have a button that allows the user to add a 
     1057copy of the field input. Currently, this only works for C<text> and 
     1058C<file> fields. Growable fields also require JavaScript to function 
     1059correctly. 
     1060 
     1061    # you can have as many people as you like 
     1062    person*:text 
     1063 
    10561064For the input types that can have options (C<select>, C<radio>, and 
    10571065C<checkbox>), here's how you do it: 
     
    12121220sections. 
    12131221 
     1222And of course, to Nathan Wiger, for giving use CGI::FormBuilder in the 
     1223first place. Thanks Nate! 
     1224 
    12141225=head1 AUTHOR 
    12151226 
  • trunk/lib/Text/FormBuilder/grammar

    r59 r61  
    151151group_name: /%[A-Z_]+/ 
    152152 
    153 field: name field_size(?) label(?) hint(?) type(?) default(?) option_list(?) validate(?) 
     153field: name field_size(?) growable(?) label(?) hint(?) type(?) default(?) option_list(?) validate(?) 
    154154    { 
    155155        my $field = { 
    156156            name     => $item{name}, 
     157            growable => ($item{'growable(?)'}[0] ? 1 : 0), 
    157158            label    => $item{'label(?)'}[0], 
    158159            comment  => $item{'hint(?)'}[0], 
     
    203204    { $rows = $item[1]; $cols = $item[3] } 
    204205 
     206growable: '*' 
     207 
    205208label: '|' (simple_multiword | quoted_string) { $item[2] } 
    206209 
Note: See TracChangeset for help on using the changeset viewer.