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:
parent
d7fd89ce9d
commit
744568108f
2 changed files with 6 additions and 10 deletions
|
|
@ -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").' />';
|
||||
|
|
|
|||
|
|
@ -59,15 +59,8 @@ Renders a button.
|
|||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $value = $self->fixQuotes($self->getOriginalValue);
|
||||
my $extras = $self->get("extras") || q|class="forwardButton"|;
|
||||
my $i18n = WebGUI::International->new($self->session);
|
||||
$self->{_params}{extras} ||= 'onclick="this.value=\''.$i18n->get(452).'\'"';
|
||||
my $html = '<input type="submit" ';
|
||||
$html .= 'name="'.$self->get("name").'" ' if ($self->get("name"));
|
||||
$html .= 'id="'.$self->get('id').'" ' unless ($self->get('id') eq "_formId");
|
||||
$html .= 'value="'.$value.'" '.$extras.' />';
|
||||
return $html;
|
||||
$self->{_params}{extras} ||= 'class="forwardButton" onclick="this.value=\''.$i18n->get(452).'\'"';
|
||||
return $self->SUPER::toHtml;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue