my $self = shift;
my ($name, $value, $attr) = $self->_attr(2, @_);
- $attr = {type => 'hidden', name => $name, value => $value};
- #TODO: $attr
+ $attr->{name } = $name if defined $name;
+ $attr->{value} = $value if defined $value;
+ $attr->{type} = 'hidden' unless defined $attr->{type};
return $self->tag(input => $attr);
}
use Test::More;
-plan tests => 50;
+plan tests => 51;
use_ok('HTML::Form::Simple');
'hidden'
);
-#TODO: hidden options
+is(
+ $form->hidden(undef, undef, {value => 'bar', name => 'foo', id => 'foo'}),
+ '<input id="foo" name="foo" type="hidden" value="bar">',
+ 'hidden options'
+);
# submit