Index: openacs-4/packages/acs-templating/tcl/form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/form-procs.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-templating/tcl/form-procs.tcl 2 Jan 2003 17:11:09 -0000 1.9 +++ openacs-4/packages/acs-templating/tcl/form-procs.tcl 9 Jan 2003 11:55:09 -0000 1.10 @@ -70,6 +70,14 @@ template::util::get_opts $args + if { [exists_and_not_null opts(cancel_url)] && ![exists_and_not_null opts(cancel_label)] } { + set opts(cancel_label) "Cancel" + } + + if { [exists_and_not_null opts(cancel_url)] } { + lappend opts(buttons) [list $opts(cancel_label) cancel] + } + set elements [list] # check whether this form is being submitted @@ -82,6 +90,12 @@ set submission [string equal $id [ns_queryget form:id]] } + if { $submission && ![empty_string_p [ns_queryget "cancel"]] && [exists_and_not_null opts(cancel_url)]} { + # If the user hit a button named "cancel", + ad_returnredirect $opts(cancel_url) + ad_script_abort + } + if { ![empty_string_p [ns_queryget "__edit"]] } { # The magic button named __edit means we should now be in edit mode set submission 0