HTML-FormFu

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.09010 2012-10-05

    - Internal changes - all Repeatable/nested_name munging is moved out of
      HTML::FormFu::Element::Repeatable into individual constraints

0.09009 2012-09-29
    - Make sure object can('checked') before calling checked() (colinnewell)
    - Updated Repeatable control to update id_field on DBIC::Unique if present
    - ComboBox new get_select_field_nested_name(), get_text_field_nested_name()
      accessors.
    - Fieldset new legend_attributes() method.
    - New form_error_message_class() method.
    - Constraint 'when' callback now receives $constraint as 2nd argument.

0.09007 2012-01-23
    - bump MooseX::Attribute::Chained version

0.09006 2012-01-23
    - fixed deprecation warnings of MX::Attribute::Chained (bricas)
    - Added placeholder attributes for types Text and Textarea with L10N support.
    - Added L10N support for 'prefix' attributes for types Date and DateTime.

MANIFEST  view on Meta::CPAN

t/elements/error_attributes_failing_test.select-with-attrs.yml
t/elements/error_attributes_failing_test.select.yml
t/elements/error_attributes_failing_test.t
t/elements/error_attributes_failing_test.text-with-attrs.yml
t/elements/error_attributes_failing_test.text.yml
t/elements/escaping.t
t/elements/field_default_empty_value.t
t/elements/field_default_empty_value.yml
t/elements/field_non_param.t
t/elements/fieldset.t
t/elements/fieldset_legend_attrs.t
t/elements/fieldset_legend_attrs.yml
t/elements/file.t
t/elements/file_post.txt
t/elements/file_post_cgi_simple.t
t/elements/hidden.t
t/elements/hr.t
t/elements/image.t
t/elements/label.t
t/elements/label.yml
t/elements/label_value_submission.t
t/elements/label_value_submission.yml

examples/unicode/root/formfu/field  view on Meta::CPAN

[% IF self.container_tag.defined %]<[% self.container_tag %][% process_attrs(self.container_attributes) %]>[% END %][% IF self.label.defined && self.label_tag == 'legend' %]
[% INCLUDE $self.label_filename %][% END %][% IF self.errors %][% FOREACH error = self.errors %]
<span class="error_message [% error.class %]">[% error.message %]</span>[% END %][% END %][% IF self.label.defined && self.label_tag != 'legend' %]
[% INCLUDE $self.label_filename %][% END %][% IF self.container_tag.defined %]
[% END %][% content %][% IF self.comment.defined %]
<span[% process_attrs(self.comment_attributes) %]>
[% self.comment %]
</span>[% END %][% IF self.container_tag.defined %]
</[% self.container_tag %]>[% END %][% IF self.javascript.defined %]
<script type="text/javascript">
[% self.javascript %]
</script>[% END %]

examples/unicode/root/formfu/start_block  view on Meta::CPAN

[% IF self.tag.defined %]<[% self.tag %][% process_attrs(self.attributes) %]>[% END %][% IF self.legend.defined %]
<legend>[% self.legend %]</legend>[% END %]

examples/unicode/root/forms/view.conf  view on Meta::CPAN

<auto_fieldset>
 legend Demo Form
</auto_fieldset>

languages de

<element>
  type Text
  name yml
  label From the form config ->
  default ü
</element>

examples/unicode/root/forms/view.yml  view on Meta::CPAN

auto_fieldset:
    legend: Demo Form

languages: [de]

elements:
  - type: Text
    name: yml
    label: 'From the form config ->'
    default: 'ü'

  - type: Text

examples/vertically-aligned-css/vertically-aligned.html  view on Meta::CPAN

<!--[if IE]>
	<style type="text/css" media="all">
		@import "vertically-aligned-ie.css";
	</style>
<![endif]-->
</head>
<body>

<form action="" enctype="multipart/form-data" id="form" method="post">
<fieldset>
<legend>A fieldset</legend>
<input name="h1" type="hidden" id="h1" />
<div class="text label">
<label for="t1">a Text element</label>
<input name="t1" type="text" id="t1" />
</div>
<div class="text comment label">
<label for="t2">another, with a comment</label>
<input name="t2" type="text" id="t2" />
<span class="comment">
comment here!

examples/vertically-aligned-css/vertically-aligned.html  view on Meta::CPAN

</optgroup>
<option value="3">non-optgroup</option>
<optgroup label="opt2">
<option value="4">four</option>
<option value="5">five</option>
</optgroup>
</select>
</div>
</fieldset>
<fieldset>
<fieldset class="radiogroup legend">
<legend>a RadioGroup element</legend>
<span>
<span>
<input name="rg1" type="radio" value="one" id="rg1_1" />
<label for="rg1_1">One</label>
</span>
<span>
<input name="rg1" type="radio" value="two" id="rg1_2" />
<label for="rg1_2">Two</label>
</span>
</span>
</fieldset>
<fieldset class="radiogroup legend">
<legend>another styled vertically</legend>
<span class="vertical">
<span>
<input name="rg2" type="radio" value="one" id="rg2_1" />
<label for="rg2_1">One</label>
</span>
<span>
<input name="rg2" type="radio" value="two" id="rg2_2" />
<label for="rg2_2">Two</label>
</span>
</span>
</fieldset>
<fieldset class="radiogroup legend">
<legend>another, styled vertically, with sub-groups</legend>
<span class="vertical">
<span class="subgroup">
<span>
<input name="rg3" type="radio" value="1" id="rg3_1" />
<label for="rg3_1">one</label>
</span>
<span>
<input name="rg3" type="radio" value="2" id="rg3_2" />
<label for="rg3_2">two</label>
</span>

examples/vertically-aligned-css/vertically-aligned.yml  view on Meta::CPAN

---
id: form
auto_id: %n
default_args:
  elements:
    Radiogroup:
      auto_id: %n_%c

auto_fieldset:
  legend: A fieldset

elements:
  - type: Hidden
    name: h1
  - type: Text
    name: t1
    label: a Text element
  - type: Text
    name: t2
    label: another, with a comment

lib/HTML/FormFu/Element/Block.pm  view on Meta::CPAN


    my $html = '';

    if ( defined $render->{tag} ) {
        $html .= sprintf "<%s%s>",
            $render->{tag},
            process_attrs( $render->{attributes} ),
            ;
    }

    if ( defined $render->{legend} ) {
        $html .=
            sprintf "\n<legend%s>%s</legend>",
            defined( $render->{legend_attributes} )
            ? process_attrs( $render->{legend_attributes} )
            : '',
            $render->{legend};
    }

    # block template

    $html .= "\n";

    if ( defined $render->{content} ) {
        $html .= sprintf "%s\n", $render->{content};
    }
    else {

lib/HTML/FormFu/Element/Checkboxgroup.pm  view on Meta::CPAN


has reverse_group => (
    is     => 'rw',
    traits => ['Chained'],
);

after BUILD => sub {
    my ( $self, $args ) = @_;

    $self->layout_field_filename('field_layout_checkboxgroup_field');
    $self->label_tag('legend');
    $self->container_tag('fieldset');
    $self->multi_value(1);
    $self->reverse_group(1);
    $self->input_type('checkbox');

    $self->layout( [ 'label', 'errors', 'field', 'comment', 'javascript', ] );

    return;
};

lib/HTML/FormFu/Element/Fieldset.pm  view on Meta::CPAN


package HTML::FormFu::Element::Fieldset;
$HTML::FormFu::Element::Fieldset::VERSION = '2.07';
# ABSTRACT: Fieldset element

use Moose;
extends 'HTML::FormFu::Element::Block';

use HTML::FormFu::Util qw( xml_escape );

__PACKAGE__->mk_output_accessors(qw( legend ));

__PACKAGE__->mk_attrs(qw( legend_attributes ));

after BUILD => sub {
    my $self = shift;

    $self->tag('fieldset');

    return;
};

sub render_data_non_recursive {
    my ( $self, $args ) = @_;

    my $render = $self->SUPER::render_data_non_recursive(
        {   legend            => $self->legend,
            legend_attributes => xml_escape( $self->legend_attributes ),
            $args ? %$args : (),
        } );

    return $render;
}

__PACKAGE__->meta->make_immutable;

1;

lib/HTML/FormFu/Element/Fieldset.pm  view on Meta::CPAN

=head1 SYNOPSIS

    my $fs = $form->element( Fieldset => 'address' );

=head1 DESCRIPTION

Fieldset element.

=head1 METHODS

=head2 legend

If L</legend> is set, it is used as the fieldset's legend

=head2 legend_loc

Arguments: $localization_key

To set the legend to a localized string, set L</legend_loc> to a key in
your L10N file instead of using L</legend>.

=head1 SEE ALSO

Is a sub-class of, and inherits methods from
L<HTML::FormFu::Element::Block>,
L<HTML::FormFu::Element>

L<HTML::FormFu>

=head1 AUTHOR

lib/HTML/FormFu/OutputProcessor/StripWhitespace.pm  view on Meta::CPAN

use HTML::TokeParser::Simple;
use List::Util 1.33 qw( any );

has collapse_tags => (
    is      => 'rw',
    default => sub {
        [ qw(
                fieldset
                form
                hr
                legend
                optgroup
                option
                table
                td
                th
                tr
                ) ];
    },
    lazy   => 1,
    traits => ['Chained'],

lib/HTML/FormFu/Role/Element/Field.pm  view on Meta::CPAN

    # field wrapper template - start

    my $html = '';

    if ( defined $render->{container_tag} ) {
        $html .= sprintf '<%s%s>',
            $render->{container_tag},
            process_attrs( $render->{container_attributes} );
    }

    if ( defined $render->{label} && $render->{label_tag} eq 'legend' ) {
        $html .= sprintf "\n%s", $self->_string_label($render);
    }

    $html .= $self->_string_errors($render);

    if (   defined $render->{label}
        && $render->{label_tag} ne 'legend'
        && !$render->{reverse_single} )
    {
        $html .= sprintf "\n%s", $self->_string_label($render);
    }

    if ( defined $render->{container_tag} ) {
        $html .= "\n";
    }

    return $html;

lib/HTML/FormFu/Role/Element/Field.pm  view on Meta::CPAN

}

sub _string_field_end {
    my ( $self, $render ) = @_;

    # field wrapper template - end

    my $html = '';

    if (   defined $render->{label}
        && $render->{label_tag} ne 'legend'
        && $render->{reverse_single} )
    {
        $html .= sprintf "\n%s", $self->_string_label($render);
    }

    if ( defined $render->{comment} ) {
        $html .= sprintf "\n<span%s>\n%s\n</span>",
            process_attrs( $render->{comment_attributes} ),
            $render->{comment},
            ;

lib/HTML/FormFu/Role/Element/Field.pm  view on Meta::CPAN


The generated string will be passed to L</localize> to create the label.

Is an L<inheriting accessor|HTML::FormFu/INHERITING ACCESSORS>.

=head3 label_tag

Default value: 'label'
(except L<Checkboxgroup|HTML::FormFu::Element::Checkboxgroup>)

Default value: 'legend'
(only L<Checkboxgroup|HTML::FormFu::Element::Checkboxgroup>)

Set which tag is used to wrap a L<label|/label>.

Is an L<inheriting accessor|HTML::FormFu/INHERITING ACCESSORS>.

=head3 label_attributes

Attributes added to the label container.

share/templates/tt/xhtml/start_block  view on Meta::CPAN

[% IF self.tag.defined %]<[% self.tag %][% process_attrs(self.attributes) %]>[% END %][% IF self.legend.defined %]
<legend[% IF self.legend_attributes.defined %][% process_attrs(self.legend_attributes) %][% END %]>[% self.legend %]</legend>[% END %]

t/04basic.t  view on Meta::CPAN


use Test::More tests => 7;

use HTML::FormFu;

my $form = HTML::FormFu->new(
    { tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );

$form->action('/foo/bar')->id('form')->auto_id('%n');

my $fs = $form->element('Fieldset')->legend('Jimi');

$fs->element('Text')->name('age')->label('Age')->comment('x')
    ->constraints( [ 'Integer', 'Required', ] );

$fs->element('Text')->name('name')->label('Name');
$fs->element('Hidden')->name('ok')->value('OK');

$form->constraints(
    {   type => 'Required',
        name => 'name',

t/04basic.t  view on Meta::CPAN

$form->filter('HTMLEscape');

# hash-ref

my $alt_hash = {
    action   => '/foo/bar',
    id       => 'form',
    auto_id  => '%n',
    elements => [
        {   type     => 'Fieldset',
            legend   => 'Jimi',
            elements => [
                {   type        => 'Text',
                    name        => 'age',
                    label       => 'Age',
                    comment     => 'x',
                    constraints => [ 'Integer', 'Required', ],
                },
                { type => 'Text',   name => 'name', label => 'Name', },
                { type => 'Hidden', name => 'ok',   value => 'OK', },
            ],

t/04basic.t  view on Meta::CPAN

my $alt_form = HTML::FormFu->new($alt_hash);
$alt_form->tt_args( { INCLUDE_PATH => 'share/templates/tt/xhtml' } );

my $yml_form = HTML::FormFu->new(
    { tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );
$yml_form->load_config_file('t/04basic.yml');

my $xhtml = <<EOF;
<form action="/foo/bar" id="form" method="post">
<fieldset>
<legend>Jimi</legend>
<div>
<label for="age">Age</label>
<input name="age" type="text" id="age" />
<span>
x
</span>
</div>
<div>
<label for="name">Name</label>
<input name="name" type="text" id="name" />

t/04basic.yml  view on Meta::CPAN

---
action: /foo/bar
id: form
auto_id: '%n'
elements:
  - type: Fieldset
    legend: Jimi
    elements:
      - name: age
        type: Text
        comment: x
        label: Age
        constraints: [Integer, Required]
      - name: name
        type: Text
        label: Name
      - name: ok

t/elements/checkboxgroup.t  view on Meta::CPAN

<input name="foo3" type="checkbox" value="1" />
<label>Ein</label>
</span>
<span>
<input name="foo3" type="checkbox" value="2" class="foobar" />
<label>Zwei</label>
</span>
</span>
</fieldset>
<fieldset>
<legend>My Bar</legend>
<span>
<span>
<input name="bar" type="checkbox" value="one" />
<label>One</label>
</span>
<span>
<input name="bar" type="checkbox" value="two" checked="checked" />
<label>Two</label>
</span>
<span>

t/elements/checkboxgroup.t  view on Meta::CPAN

<span>
<input name="foo" type="checkbox" value="2" checked="checked" />
<label>Two</label>
</span>
</span>
</fieldset>};

    is( $form->get_field('foo'), $foo_xhtml, 'checkboxgroup after query' );

    my $bar_xhtml = qq{<fieldset>
<legend>My Bar</legend>
<span>
<span>
<input name="bar" type="checkbox" value="one" />
<label>One</label>
</span>
<span>
<input name="bar" type="checkbox" value="two" />
<label>Two</label>
</span>
<span>

t/elements/fieldset.t  view on Meta::CPAN

use strict;
use warnings;

use Test::More tests => 10;

use HTML::FormFu;

my $form = HTML::FormFu->new(
    { tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );

my $outer = $form->element('Fieldset')->name('outer')->legend('My Form');
is( $outer->name, 'outer' );
is( $outer->type, 'Fieldset' );

my $inner = $outer->element('Block');
ok( !$inner->name );
is( $inner->type, 'Block' );

my $foo = $outer->element('Text')->name('foo');
is( $foo->name, 'foo' );
is( $foo->type, 'Text' );

t/elements/fieldset.t  view on Meta::CPAN

</div>};

is( "$foo", $field_xhtml );

my $inner_xhtml = qq{<div>
</div>};

is( "$inner", $inner_xhtml );

my $outer_xhtml = qq{<fieldset>
<legend>My Form</legend>
$inner_xhtml
$field_xhtml
</fieldset>};

is( "$outer", $outer_xhtml );

my $form_xhtml = <<EOF;
<form action="" method="post">
$outer_xhtml
</form>

t/elements/fieldset_legend_attrs.t  view on Meta::CPAN

use strict;
use warnings;

use Test::More tests => 1;

use HTML::FormFu;

my $form = HTML::FormFu->new(
    { tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );

my $outer = $form->load_config_file('t/elements/fieldset_legend_attrs.yml');

my $form_xhtml = <<EOF;
<form action="" method="post">
<fieldset>
<legend class="my_legend">The Legend!</legend>
The Content!
</fieldset>
</form>
EOF

is( "$form", $form_xhtml );

t/elements/fieldset_legend_attrs.yml  view on Meta::CPAN

---
elements:
  - type: Fieldset
    legend: 'The Legend!'
    legend_attrs:
      class: my_legend
    content: 'The Content!'

t/elements/radiogroup.t  view on Meta::CPAN

<input name="foo3" type="radio" value="1" />
<label>Ein</label>
</span>
<span class="item 2">
<input name="foo3" type="radio" value="2" class="foobar" />
<label>Zwei</label>
</span>
</span>
</fieldset>
<fieldset>
<legend>My Bar</legend>
<span>
<span>
<input name="bar" type="radio" value="one" />
<label>One</label>
</span>
<span>
<input name="bar" type="radio" value="two" checked="checked" />
<label>Two</label>
</span>
<span>

t/elements/radiogroup.t  view on Meta::CPAN

<span>
<input name="foo" type="radio" value="2" />
<label>Two</label>
</span>
</span>
</fieldset>};

    is( $form->get_field('foo'), $foo_xhtml, 'radiogroup after query' );

    my $bar_xhtml = qq{<fieldset>
<legend>My Bar</legend>
<span>
<span>
<input name="bar" type="radio" value="one" />
<label>One</label>
</span>
<span>
<input name="bar" type="radio" value="two" />
<label>Two</label>
</span>
<span>

t/elements/radiogroup_errors.t  view on Meta::CPAN


my $form = HTML::FormFu->new(
    { tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );

$form->indicator( sub {1} );

my $field = $form->element('Radiogroup');

$field->name('foo');
$field->values( [qw/ one two /] );
$field->label('My legend');
$field->constraint('Required');

my $xhtml = qq{<fieldset>
<legend>My legend</legend>
<span>
<span>
<input name="foo" type="radio" value="one" />
<label>One</label>
</span>
<span>
<input name="foo" type="radio" value="two" />
<label>Two</label>
</span>
</span>
</fieldset>};

is( "$field", $xhtml );

# With mocked basic query
{
    $form->process( {} );

    my $xhtml = qq{<fieldset>
<legend>My legend</legend>
<span>This field is required</span>
<span>
<span>
<input name="foo" type="radio" value="one" />
<label>One</label>
</span>
<span>
<input name="foo" type="radio" value="two" />
<label>Two</label>
</span>

t/examples/custom_label.t  view on Meta::CPAN

}
else {
    plan tests => 1;
}

use HTML::FormFu;

my $form = HTML::FormFu->new(
    { tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );

$form->auto_fieldset( { legend => 'Foo' } );

$form->element('Text')->name('foo')->label('Foo');
$form->element('Text')->name('bar')->label('Bar');
$form->element('Hidden')->name('baz');
$form->element('Submit')->name('submit');

my $template = Template->new;
my $output;

$template->process( \*DATA, { form => $form }, \$output )
    or die $template->error;

my $xhtml = <<EOF;
<html>
<body>
<form action="" method="post">
<fieldset>
<legend>Foo</legend>
<label>Foo</label>: <input name="foo" type="text" />
<label>Bar</label>: <input name="bar" type="text" />
<input name="baz" type="hidden" />
<div>
<input name="submit" type="submit" />
</div>
</fieldset>
</form>
</body>
</html>

t/examples/custom_label2.t  view on Meta::CPAN

}
else {
    plan tests => 1;
}

use HTML::FormFu;

my $form = HTML::FormFu->new(
    { tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );

$form->auto_fieldset( { legend => 'Foo' } );

$form->element('Text')->name('foo')->label('Foo');
$form->element('Text')->name('bar')->label('Bar');
$form->element('Hidden')->name('baz');
$form->element('Submit')->name('submit');

my $template = Template->new;
my $output;

$template->process( \*DATA, { form => $form }, \$output )
    or die $template->error;

my $xhtml = <<EOF;
<html>
<body>
<form action="" method="post">
<fieldset>
<legend>Foo</legend>
<label>Foo</label>: <input name="foo" type="text" />
<label>Bar</label>: <input name="bar" type="text" />
<input name="baz" type="hidden" />
<div>
<input name="submit" type="submit" />
</div>
</fieldset>
</form>
</body>
</html>

t/load_config/load_config_file.t  view on Meta::CPAN


use Test::More tests => 2;

use HTML::FormFu;

my $form = HTML::FormFu->new(
    { tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );

$form->action('/foo/bar')->id('form');

my $fs = $form->element('Fieldset')->legend('Jimi');

$fs->element('Text')->name('age')->label('Age')->comment('x')->constraints( [
        {   type    => 'Integer',
            message => 'No integer.',
        },
        {   type    => 'Integer',
            message => 'This too!',
        },
    ] );

t/load_config/load_config_file.t  view on Meta::CPAN


$alt_form->load_config_file('t/load_config/load_config_file_form.yml');

is_deeply( $alt_form, $form );

# xhtml output

my $xhtml = <<EOF;
<form action="/foo/bar" id="form" method="post">
<fieldset>
<legend>Jimi</legend>
<div>
<label>Age</label>
<input name="age" type="text" />
<span>
x
</span>
</div>
<div>
<label>Name</label>
<input name="name" type="text" />

t/load_config/load_config_file_fieldset.yml  view on Meta::CPAN

---
legend: Jimi
elements:
 - type: Text
   name: age
   comment: x
   label: Age
   constraints:
   - type: Integer
     message: No integer.
   - type: Integer
     message: This too!

t/load_config/load_config_filestem.t  view on Meta::CPAN


use Test::More tests => 2;

use HTML::FormFu;

my $form = HTML::FormFu->new(
    { tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );

$form->action('/foo/bar')->id('form');

my $fs = $form->element('Fieldset')->legend('Jimi');

$fs->element('Text')->name('age')->label('Age')->comment('x')->constraints( [
        {   type    => 'Integer',
            message => 'No integer.',
        },
        {   type    => 'Integer',
            message => 'This too!',
        },
    ] );

t/load_config/load_config_filestem.t  view on Meta::CPAN


$alt_form->load_config_filestem('t/load_config/load_config_file_form');

is_deeply( $alt_form, $form );

# xhtml output

my $xhtml = <<EOF;
<form action="/foo/bar" id="form" method="post">
<fieldset>
<legend>Jimi</legend>
<div>
<label>Age</label>
<input name="age" type="text" />
<span>
x
</span>
</div>
<div>
<label>Name</label>
<input name="name" type="text" />

t/output_processors/indent_internals.t  view on Meta::CPAN

my $form = HTML::FormFu->new;

my $proc = $form->output_processor(
    {   type   => 'Indent',
        indent => " " x 4,
    } );

my $input = <<INPUT;
<form action="" method="post">
<fieldset>
<legend>Legend</legend>
<input name="hidden" type="hidden" value="1" />
<pre>
    foo bar
</pre>
<span>
<label for="text">Label</label>
<input name="text" type="text" />
<span>Comment</span>
</span>
<span>

t/output_processors/indent_internals.t  view on Meta::CPAN

<span>
<input name="submit" type="submit" />
</span>
</fieldset>
</form>
INPUT

my $output = <<OUTPUT;
<form action="" method="post">
    <fieldset>
        <legend>Legend</legend>
        <input name="hidden" type="hidden" value="1" />
        <pre>
    foo bar
</pre>
        <span>
            <label for="text">Label</label>
            <input name="text" type="text" />
            <span>Comment</span>
        </span>
        <span>

t/output_processors/strip_whitespace.t  view on Meta::CPAN


my $form = HTML::FormFu->new(
    { tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );

$form->load_config_file('t/output_processors/strip_whitespace.yml');

{
    my $xhtml = <<XHTML;
<form action="" method="post">
<fieldset>
<legend>fieldset</legend>
<input name="hidden" type="hidden" value="1" />
<div>
<label>Foo</label>
<input name="foo" type="text" />
</div>
<div>
<textarea name="textarea" cols="40" rows="20">foo
bar
</textarea>
</div>

t/output_processors/strip_whitespace.t  view on Meta::CPAN

</form>
XHTML

    is( "$form", $xhtml );
}

$form->output_processor('StripWhitespace');

{
    my $xhtml
        = qq{<form action="" method="post"><fieldset><legend>fieldset</legend><input name="hidden" type="hidden" value="1" />
<div>
<label>Foo</label>
<input name="foo" type="text" />
</div><div>
<textarea name="textarea" cols="40" rows="20">foo
bar
</textarea>
</div><div>
<select name="select"><option value="a">A</option><option value="b">B</option><option value="d">D</option></select>
</div><div>

t/output_processors/strip_whitespace.yml  view on Meta::CPAN

---
auto_fieldset:
  legend: "fieldset"

elements:
  - type: Hidden
    name: hidden
    value: 1

  - type: Text
    name: foo
    label: Foo



( run in 1.387 second using v1.01-cache-2.11-cpan-49f99fa48dc )