ignore empty style and class attributes
[perl/html-form-simple.git] / lib / HTML / Form / Simple.pm
index b4e42aa947260cf57be5d1d17519991f454f54d8..6e84888296e51a5deb508b6232f69a0c00c085cf 100644 (file)
@@ -22,7 +22,7 @@ sub tag {
 
        # strip empty if it shouldn't be
        defined $attr->{$_} and $attr->{$_} eq '' and delete $attr->{$_}
-               for qw(id type);
+               for qw(id type class style);
 
        my $return = '<' . $tag;
 
@@ -129,7 +129,12 @@ HTML::Form::Simple
        my $input = HTML::Form::Simple->new;
        say $input->start; # <form>
        printf "<label>%s: %s</label>\n", @$_ for (
-               [ 'Your Name' => $input->text(username => 'Mr. Default') ],
+               [ 'Your Name' => $input->text(
+                       user => 'Mr. Default'
+               ) ],
+               [ Message => $input->text(
+                       msg => 'Textarea default', {rows => 4, style => 'background:red'}
+               ) ],
                [ Colour => $input->select(
                        favcolour => [qw(Blue Green Red)], 'Green'
                ) ],