Forum OpenACS Development: Re: Form-builder display/edit modes

Collapse
Posted by Lars Pind on
Not really. I made Cancel not on by default. But you still have to manually catch the cancel button and do a redirect in your Tcl file.

I don't see any other way. Of course, I could make sure that [form is_valid ...] returns false, but the form by default doesn't know where you should go in case of a cancel.

Hm, of course we could add that as another switch to the form element.

form create -buttons [list [list ok OK] [list cancel Cancel $return_url]]

?

/Lars

Collapse
Posted by Tilmann Singer on
What about something like:
form create edit \
  -cancel_url $return_url \
  -cancel_label "Cancel"
where cancel_label would be "Cancel" by default or the i18n-ised default, and the button would only appear if cancel_url is specified? This would fit in better with the self-describing api of the form builder IMHO.