Changeset 56 in text-formbuilder for trunk/lib/Text
- Timestamp:
- 01/13/05 15:00:25 (20 years ago)
- Location:
- trunk/lib/Text
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Text/FormBuilder.pm
r55 r56 624 624 =head1 REQUIRES 625 625 626 L<Parse::RecDescent>, L<CGI::FormBuilder>, L<Text::Template> 626 L<Parse::RecDescent>, 627 L<CGI::FormBuilder>, 628 L<Text::Template>, 629 L<Class::Base> 627 630 628 631 =head1 DESCRIPTION … … 1043 1046 description[4,30]:textarea 1044 1047 1048 To also set the C<maxlength> attribute for text fields, add a C<!> after 1049 the size: 1050 1051 # ensure that all titles entered are 40 characters or less 1052 title[40!]:text 1053 1054 This currently only works for single line text fields. 1055 1045 1056 For the input types that can have options (C<select>, C<radio>, and 1046 1057 C<checkbox>), here's how you do it: -
trunk/lib/Text/FormBuilder/grammar
r55 r56 19 19 $list_var, 20 20 $size, 21 $maxlength, 21 22 $rows, 22 23 $cols, … … 157 158 $$field{cols} = $cols if defined $cols; 158 159 $$field{size} = $size if defined $size; 160 $$field{maxlength} = $maxlength if defined $maxlength; 159 161 160 162 #warn "[$thisline] field $item{name}; context $context\n"; … … 171 173 $rows = undef; 172 174 $cols = undef; 175 $maxlength = undef; 173 176 @options = (); 174 177 … … 181 184 field_size: '[' ( row_col | size ) ']' 182 185 183 size: /\d+/ 184 { $size = $item[1] } 186 size: /\d+/ bang(?) 187 { $maxlength = $item[1] if $item[2][0]; $size = $item[1] } 188 189 bang: '!' 185 190 186 191 row_col: /\d+/ /,\s*/ /\d+/
Note: See TracChangeset
for help on using the changeset viewer.