[Zope] What button submitted

Max M maxmcorp@worldonline.dk
Thu, 8 Mar 2001 18:10:15 +0100


From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Axel
Missbach

>having a form with some buttons.(Add, Edit, Del...). Every button shoulg
>call the same form, wich one should handle the diffrent button-methods.
>Please tell me a way how to get to know which button is pressed. Every
>button is in the REQUEST, but i can't see, which one is the caller.

You are doing thing the wrong way around here. You can make zope call a
method for you, so you don't have to see what button has been called.

These two buttons will call the methods save() and delete() in your class.

<input type="submit" name="save:method" value="  Save  ">
<input type="submit" name="delete:method" value="  Delete  ">

You must then make methods that can reply to these methods. Ie. you can make
two dtml methods or Python scripts called save and delete in the object that
holds you form.

regards Max M