[Zope] Delete multiple posts

Casey Duncan cduncan@kaivo.com
Tue, 03 Apr 2001 10:15:18 -0600


Gitte Wange wrote:
> 
> Well that helped a little.
> I set the Form ACTION-tag to sqlDeleteClips (which is my sql method) and
> the checkbox name to "ids:list"
> When I hit the submit button, you see a Zope page where there is a input
> box to enter the ids in .. but I just want it do delete the ones that
> are selected ???
> 

You can't point the action of the form directly to the SQL method
because it is not a web template. I would suggest having the form call
itself and add some dtml logic at the top to determine that the user
deleted something. Have it then fire off the SQL method before drawing
the checkboxes. Something like so:

<dtml-if delete>
	<dtml-call name="sqlDeleteClips">
</dtml-if>

<form action="&dtml-URL;">
<dtml-in sqlSelectClips>
    <input type="checkbox" name="ids:list" value="&dtml-id;" />
    <dtml-var name="title"><br />
</dtml-in>
<input type="submit" name="delete" value="Delete" />
</form>

Substitute your field names for "id" and "title" above.
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>