Home
The Toolkit for Online Communities
15899 Community Members, 0 members online, 2515 visitors today
Log In Register

Forum OpenACS Q&A: Re: ad_form skips on_submit and after_submit code

OpenACS Home : Forums : OpenACS Q&A : Re: ad_form skips on_submit and after_submit code : One Message

+
Posted by Claudio Pasolini on
The canonical way of using ad_form is to specify a form element as key.

If you add:

istruttori_id:key

to your form declaration and also a -edit_request section (even if empty) things will work.

As a side note using ad_returnredirect in this way seems unnecessarily complicated: simply add:

-action orari-inse-q \

to the form declaration and you are done.

+
Posted by Dave Bauer on
I am not sure why you are using a form to collect the data and then redirecting with all the data to another script.

You should put all the processing instructions in the on_submit block.

Also if you need to redirect look at using

export_vars

procedure to build the URL instead of creating a string.

+
Posted by David Siktberg on
Re Dave's comment on proper usage, I would love to learn how to use ad_form, but the documentation I have found seems light on examples, the ad_form code seemed a bit dense to read and understand on its own, and therefore a long sit-down and read-thru and pondering seemed called for, and I have never found the time to do that. Could someone be generous enough to post a good example or two showing some significant functionality in a page that obtains and processes input? That will be a fast way to learn, and I would be very, very grateful. Or if there is documentation with examples somewhere that would also be great to learn about. Thanks!!
+
Posted by Ryan Gallimore on
Hi David,

There are loads of examples in the code itself - just grep ad_form.

Here is also a good reference:

http://openacs.org/storage/view/ad-form-quick-ref.pdf

And the OpenACS Tutorial:

http://openacs.org/storage/index?folder_id=2855304

Cheers.

+
Posted by Gustaf Neumann on
See for a collection of articles as well under: http://openacs.org/rubick/