Changeset 38 in text-formbuilder for trunk


Ignore:
Timestamp:
12/06/04 14:22:54 (20 years ago)
Author:
peter
Message:

more documentation
upped version number

File:
1 edited

Legend:

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

    r35 r38  
    66use vars qw($VERSION); 
    77 
    8 $VERSION = '0.06'; 
     8$VERSION = '0.07_01'; 
    99 
    1010use Carp; 
     
    100100     
    101101    # css, extra_css: allow for custom inline stylesheets 
    102     #   neat trick: extra_css => '@import(my_external_stylesheet.css);' 
     102    #   neat trick: css => '@import(my_external_stylesheet.css);' 
    103103    #   will let you use an external stylesheet 
    104104    #   CSS Hint: to get multiple sections to all line up their fields, 
     
    109109     
    110110    # messages 
     111    # code pulled (with modifications) from CGI::FormBuilder 
    111112    if ($options{messages}) { 
    112113        # if its a hashref, we'll just pass it on to CGI::FormBuilder 
     
    213214    } 
    214215     
    215     # TODO: configurable threshold for this 
    216216    foreach (@{ $self->{form_spec}{fields} }) { 
    217217        $$_{ulist} = 1 if ref $$_{options} and @{ $$_{options} } >= 3; 
     
    527527=head1 DESCRIPTION 
    528528 
     529This module is intended to extend the idea of making it easy to create 
     530web forms by allowing you to describe them with a simple langauge. These 
     531I<formspecs> are then passed through this module's parser and converted 
     532into L<CGI::FormBuilder> objects that you can easily use in your CGI 
     533scripts. In addition, this module can generate code for standalone modules 
     534which allow you to separate your form design from your script code. 
     535 
     536A simple formspec looks like this: 
     537 
     538    name//VALUE 
     539    email//EMAIL 
     540    langauge:select{English,Spanish,French,German} 
     541    moreinfo|Send me more information:checkbox 
     542    interests:checkbox{Perl,karate,bass guitar} 
     543 
     544This will produce a required C<name> test field, a required C<email> text 
     545field that must look like an email address, an optional select dropdown 
     546field C<langauge> with the choices English, Spanish, French, and German, 
     547an optional C<moreinfo> checkbox labeled ``Send me more information'', and 
     548finally a set of checkboxes named C<interests> with the choices Perl, 
     549karate, and bass guitar. 
     550 
    529551=head2 new 
     552 
     553    my $parser = Text::FormBuilder->new; 
    530554 
    531555=head2 parse 
     
    573597appended to the CSS. If both options are given, then the CSS that is 
    574598used will be C<css> concatenated with C<extra_css>. 
     599 
     600If you want to use an external stylesheet, a quick way to get this is 
     601to set the C<css> parameter to import your file: 
     602 
     603    css => '@import(my_external_stylesheet.css);' 
    575604 
    576605=item C<messages> 
Note: See TracChangeset for help on using the changeset viewer.