CGI-FormBuilder
    
    
  
  
  
view release on metacpan or search on metacpan
            sex:
                label:    Gender
                options:  M=Male, F=Female
                jsclick:  javascript:alert("Change your mind??");
                validate: M,F
        required: ALL
        messages:
            form_invalid_text:  Please correct the following fields:
            form_required_text: Please fill in all <b>bold</b> fields.
    You can even pre-parse this file, and generate a module from it which
    you can then reuse in multiple scripts using the "write_module()"
    function. For more details, see CGI::FormBuilder::Source::File.
  "Other" Fields
    The new "other" option has been added to "field()". If specified, a text
    box will be added to the right of the field, and its value will be used
    if the main field is not filled in. It will be subject to the same
    required and validation checks as the main field:
lib/CGI/FormBuilder.pod view on Meta::CPAN
    }
You can also provide a L<Data::FormValidator> object as the first
argument. In that case, the second argument (if present) will be
interpreted as the name of the validation profile to use. A single
string argument will also be interpreted as a validation profile
name.
Note that if you pass args to your C<validate()> function like
this, you will not get JavaScript generated or required fields
placed in bold. So, this is good for conditional validation
like the above example, but for most applications you want to
pass your validation requirements in via the C<validate>
option to the C<new()> function, and just call the C<validate()>
function with no arguments.
=head2 confirm()
The purpose of this function is to print out a static confirmation
screen showing a short message along with the values that were
submitted. It is actually just a special wrapper around C<render()>,
lib/CGI/FormBuilder.pod view on Meta::CPAN
    .fb_comment {
        font-size: 8pt;
        font-style: italic;
    }
    .fb_submit {
        text-align: center;
    }
    .fb_required {
        font-weight: bold;
    }
    .fb_invalid {
        color: #c00;
        font-weight: bold;
    }
    .fb_error {
        color: #c00;
        font-style: italic;
    }
Of course, if you're familiar with CSS, you know a lot more is possible.
Also, you can mess with all the id's (if you name your forms) to
manipulate fields more exactly.
pod/Changes.pod view on Meta::CPAN
        sex:
            label:    Gender
            options:  M=Male, F=Female
            jsclick:  javascript:alert("Change your mind??");
            validate: M,F
    required: ALL
    messages:
        form_invalid_text:  Please correct the following fields:
        form_required_text: Please fill in all <b>bold</b> fields.
You can even pre-parse this file, and generate a module from it
which you can then reuse in multiple scripts using the C<write_module()>
function. For more details, see L<CGI::FormBuilder::Source::File>.
=head2 "Other" Fields
The new C<other> option has been added to C<field()>. If specified,
a text box will be added to the right of the field, and its value
will be used if the main field is not filled in. It will be subject
t/2a-test04.html view on Meta::CPAN
 <!-- JavaScript validation code -->
 
</head>
<body>
<form action="TEST" method="post"><input id="_submitted" name="_submitted" type="hidden" value="1" />
  test form page:<br/>
  <table>
  
  <tr>
    <td class="bold">Field1<!-- label --></td>
    <td><input id="field1" name="field1" type="text" value="109" /><!-- field --><i>Hello</i><!-- comment --></td>
  </tr>
  
  <tr>
    <td class="bold">Reefer<!-- label --></td>
    <td><input id="field2" name="field2" type="submit" value="1 < 2 < 3" /><!-- field --><i>goodbyE@</i><!-- comment --></td>
  </tr>
  
  <tr>
    <td class="bold">Field3<!-- label --></td>
    <td><input id="field3" name="field3" type="button" value="<<PUSH>>" /><!-- field --><i>onSubmit</i><!-- comment --></td>
  </tr>
  
  </table>
  <br/>
  <!-- buttons -->
<input id="_submit" name="_submit" type="submit" value="Submit" />
</form>
</body>
t/2a-test99.html view on Meta::CPAN
 <!-- JavaScript validation code -->
 <tmpl_var js-head>
</head>
<body>
<tmpl_var form-start>
  <tmpl_var form-title>:<br/>
  <table>
  <tmpl_loop fields>
  <tr>
    <td class="bold"><tmpl_var label><!-- label --></td>
    <td><tmpl_var field><!-- field --><tmpl_var comment><!-- comment --></td>
  </tr>
  </tmpl_loop>
  </table>
  <br/>
  <!-- buttons -->
<tmpl_var form-submit>
<tmpl_var form-end>
</body>
( run in 1.623 second using v1.01-cache-2.11-cpan-5dc5da66d9d )