add "type" param to button control

We're realigning Button and Submit so that Submit is just a
pre-configured Button. This should be repeated for other types
of form fields.
This commit is contained in:
Doug Bell 2011-04-11 16:34:10 -05:00
parent d7fd89ce9d
commit 744568108f
2 changed files with 6 additions and 10 deletions

View file

@ -61,6 +61,9 @@ sub definition {
defaultValue=>{
defaultValue=>$i18n->get(62)
},
type => {
defaultValue => 'button',
},
});
return $class->SUPER::definition($session, $definition);
}
@ -89,7 +92,7 @@ Renders a button.
sub toHtml {
my $self = shift;
my $value = $self->fixQuotes($self->getOriginalValue);
my $html = '<input type="button" ';
my $html = '<input type="' . $self->get('type') . '" ';
$html .= 'name="'.$self->get("name").'" ' if ($self->get("name"));
$html .= 'id="'.$self->get('id').'" ' unless ($self->get('id') eq "_formId");
$html .= 'value="'.$value.'" '.$self->get("extras").' />';