Changeset 84 in text-formbuilder


Ignore:
Timestamp:
05/11/05 14:28:57 (20 years ago)
Author:
peichman
Message:

added support for the 'multiple' attribute on fields

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Changes

    r82 r84  
    22 
    330.11 
     4    * added support for the 'multiple' attribute on fields 
    45    * added as_script and as_module methods that just return the 
    56      Perl code 
  • trunk/lib/Text/FormBuilder.pm

    r83 r84  
    11351135    static 
    11361136 
     1137For multi-select fields, append a C<*> to the field type: 
     1138 
     1139    colors:select* 
     1140 
    11371141To change the size of the input field, add a bracketed subscript after the 
    11381142field name (but before the descriptive label): 
     
    12911295=head2 Language/Parser 
    12921296 
    1293 Support the C<multiple> attribute for a field. 
    1294  
    12951297Make sure that multiple runs of the parser don't share data. 
    12961298 
  • trunk/lib/Text/FormBuilder/grammar

    r81 r84  
    1919        @options, 
    2020        $required, 
     21        $multiple, 
    2122        $list_var, 
    2223        $size, 
     
    187188 
    188189# this is the real heart of the thing 
    189 field: name field_size(?) growable(?) label(?) hint(?) type(?) other(?) default(?) option_list(?) validate(?) comment(?) 
     190field: name field_size(?) growable(?) label(?) hint(?) type(?) multi(?) other(?) default(?) option_list(?) validate(?) comment(?) 
    190191    { 
    191192        my $field = { 
     
    194195            label    => $item{'label(?)'}[0], 
    195196            comment  => $item{'hint(?)'}[0], 
     197            multiple => $item{'multi(?)'}[0], 
    196198            type     => $item{'type(?)'}[0], 
    197199            other    => $item{'other(?)'}[0], 
     
    218220        $type = undef; 
    219221        $required = undef; 
     222        $multiple = undef; 
    220223        $list_var = undef; 
    221224        $size = undef; 
     
    254257builtin_field: /textarea|text|password|file|checkbox|radio|select|hidden|static/ 
    255258 
     259multi: '*' { 1 } 
     260 
    256261other: '+' 'other' { 1 } 
    257262 
  • trunk/t/01-field.t

    r76 r84  
    1212    label    => undef, 
    1313    list     => undef, 
     14    multiple => undef, 
    1415    name     => undef, 
    1516    other    => undef, 
Note: See TracChangeset for help on using the changeset viewer.