diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 6eba6f468..1a6db209f 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -12,6 +12,7 @@ - Bugfix [ 1055396 ] Template switching issue (Len Kranendonk) - WebGUI Operations are now dynamically loaded (Len Kranendonk) - Added button to Form.pm / HTMLForm.pm (Len Kranendonk) + - Added a "Cancel" button to each tab form (Len Kranendonk) 6.2.7 - Expanded upon the help for URL extensions. diff --git a/lib/WebGUI/TabForm.pm b/lib/WebGUI/TabForm.pm index 2fd806d19..a990655e4 100644 --- a/lib/WebGUI/TabForm.pm +++ b/lib/WebGUI/TabForm.pm @@ -151,14 +151,18 @@ A string containing the link to the tab-CascadingStyleSheet =cut sub new { - my ($class, $tabs, $css); + my ($cancel, $class, $tabs, $css); $class = $_[0]; $tabs = $_[1]; $css = $_[2] || $session{config}{extrasURL}.'/tabs/tabs.css'; foreach my $key (keys %{$tabs}) { $tabs->{$key}{form} = WebGUI::HTMLForm->new; } - bless { _submit=>WebGUI::Form::submit(), _form=>WebGUI::Form::formHeader(), _hidden=>"", _tab=>$tabs, _css=>$css }, $class; + $cancel = WebGUI::Form::button({ + value=>WebGUI::International::get('cancel'), + extras=>q|onClick="location.href='|.WebGUI::URL::page().q|'"| + }); + bless { _cancel=>$cancel, _submit=>WebGUI::Form::submit(), _form=>WebGUI::Form::formHeader(), _hidden=>"", _tab=>$tabs, _css=>$css }, $class; } @@ -191,7 +195,7 @@ sub print { $form .= ''; $i++; } - $output .= '