Forum OpenACS Development: Response to ad_form for new and edit requests

Collapse
Posted by Dave Bauer on
Don,

We discussed this on IRC. He wants to also set the context and title correctly if there is an error in validation. At that point, the key will be set.

One idea I had was an ad_form_new_p proc that checks for the existence of the key, and also checks for existence of the __new_p variable so that if the request was new, but redirected due to an error in entry, it would still return as a new request. Just checking for 0 in the key won't work for that.

I am thinking of something like this:

if {[ad_form_p -key key_variable_name]} {
    set title for new request
} else {
    set title for edit request
}