How can I call a dtml-method from a button's onClick? I have a form with a submit and a "delete" button that I want to link with a dtml-method. Thank you.
Michael, How about this: <form action="." method="post"> <input type=submit name="ok:method" value=" OK "> <input type=submit name="delete:method" value="Delete"> </form> Now create two DTML Methods called 'ok' and 'delete' which do what you want when those particular buttons are pressed. These modifiers on the name are listed in the Zope Book (http://www.zope.org/Members/michel/ZB). hth Phil phil.harris@zweb.co.uk ----- Original Message ----- From: "Michael Shigeki Onishi" <MICHAELS@senado.gov.br> To: <zope@zope.org> Sent: Monday, February 19, 2001 3:00 PM Subject: [Zope] Button onClick question
How can I call a dtml-method from a button's onClick?
I have a form with a submit and a "delete" button that I want to link with a dtml-method.
Thank you.
_______________________________________________ Zope maillist - Zope@zope.org 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 )
One way to do this is to open a window via javascript, e.g.: <input type=button onclick="window.open('/this/server/a/method')"> I image you can do something like this with frames as well. If you just want to use this as an alternate submit button, you could just put the button in a separate form and call form.submit() on the button's onlick, e.g. <input type=button onclick="this.form.submit()"> ----- Original Message ----- From: "Michael Shigeki Onishi" <MICHAELS@senado.gov.br> To: <zope@zope.org> Sent: Monday, February 19, 2001 10:00 AM Subject: [Zope] Button onClick question
How can I call a dtml-method from a button's onClick?
I have a form with a submit and a "delete" button that I want to link with a dtml-method.
Thank you.
_______________________________________________ Zope maillist - Zope@zope.org 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 )
participants (3)
-
Chris McDonough -
Michael Shigeki Onishi -
Phil Harris