Forum OpenACS Development: Re: ad_form for new and edit requests

Collapse
Posted by Don Baccus on
Since everyone else seems to be adding features to ad_form willy-nilly I decided to add a minor one that helps fix a problem with submissions that have errors ...

I've added an "-on_validation_error" block executed when ... well, it is up to you to guess when it is executed.

Here's an example:

ad_form ... -new_request {
    permission::require_permission -object_id $package_id -privilege create
    set page_title "New Note"
} -edit_request {
    permission::require_permission -object_id $note_id -privilege write
    set page_title "Edit Note"
    db_1row note_select {}
} -on_validation_error {
    set page_title "Error in submission"
} -new_data {