[Zope] detail record editing

Stuart 'Zen' Bishop zen@cs.rmit.edu.au
Tue, 6 Jun 2000 19:13:21 +1000 (EST)


On Mon, 5 Jun 2000, Robert Del Huerto wrote:

> database.  I'm stuck after that.  The form only has one 'action' so how
> would I get it to handle the right function depending on the button that
> was pushed?  I'm no HTML expert but I've looked around quite a bit for

It can be done with some badly documented magic (see 
http://www.zope.org/Members/Zen/howto/FormVariableTypes when zope.org
is working again :-P)

Example:

<form action='itdoesntmatter' method=post>
<input name=afield>
<input type=submit name="delete:method" value=" Delete ">
<input type=submit name="modify:method" value=" Modify ">
</form>

In this example, the action is never called. If the user clicks on
the delete button, the method 'delete' (generally in the same folder as this
form) is called instead of the action. Similarly, click on Modify and the 
method called 'modify' is called instead of the action.

I'll try to remember to put this up as a tip on zope.org when its possible...

-- 
Stuart Bishop                          Work: zen@cs.rmit.edu.au
Senior Systems Alchemist               Play: zen@shangri-la.dropbear.id.au
Computer Science, RMIT University