[Zope] confirmation or redirect

Stephan Goeldi Stephan Goeldi" <goeldi@goeldi.com
Mon, 29 Jul 2002 14:18:39 +0200


OK. It was suggested, that I need to use JavaScript to confirm the deletion
of an object.

Can I execute some dtml tags inside of a JavaScript?

What I have is this:

<script language="JavaScript">
<!--
function confirm_entry()
{
input_box=confirm("Deleting Document. Are you sure?");
if (input_box==true)
{
// Output when OK is clicked
    <dtml-call expr="REQUEST.set('id', getId())">
    <dtml-call expr="Documents.deleteDocumentFile(REQUEST, RESPONSE)">
    <dtml-return expr="1">
}

else
{
// Output when Cancel is clicked
this.form.reset();
}

}
-->
</script>
   <input type="submit" name="delete" onclick="confirm_entry()" value="
Delete Document " />
   <input type="submit" name="cancel" onclick="this.form.reset()" value="
Cancel " />

of course, it doesn't work at all...

Stephan