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: [EMAIL PROTECTED]
Senior Systems Alchemist               Play: [EMAIL PROTECTED]
Computer Science, RMIT University



_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to