Steve:
It works for me.
The following testcase:
================
use strict;
use warnings;
use Test::More;
{
package MyApp::Form::Test;
use HTML::FormHandler::Moose;
extends 'HTML::FormHandler';
has '+name' => ( default => 'test_form' );
has_field 'foo' => ( type => 'Integer', element_attr => { size =>
'2' } );
has_field 'bar' => ( required => 1 );;
}
my $form = MyApp::Form::Test->new;
ok( $form );
$form->process( params => {} );
my $rendered = $form->render;
diag($rendered);
done_testing;
=================
Produces the following HTML:
=================
# <form id="test_form" method="post">
# <div class="form_messages">
# </div>
# <div>
# <label for="foo">Foo</label>
# <input type="text" name="foo" id="foo" size="8" value="" size="2" />
# </div>
# <div>
# <label for="bar">Bar</label>
# <input type="text" name="bar" id="bar" value="" />
# </div>
# </form>
===================
If you're getting something else, please create a testcase to
demonstrate the problem.
Gerda