a warning message before performing an action
Dears, I have a web page with some buttons (<form action=...) to perform some action (by calling a python script). However, some actions (like 'delete' a picture for example) I would like to warn user before performing it. I recall from php how to pop up a window (or a drop down in Mac OSX) with a warning message prompting a 'Yes' or 'No' confirmation and I was wondering how would I do it with Zope, with an example if possible. Any help here would be very welcome. Cheers, Alan
----- Original Message ----- From: "Alan" <alanwilter@gmail.com> To: <zope@zope.org> Sent: Thursday, June 14, 2007 11:18 AM Subject: [Zope] a warning message before performing an action
I have a web page with some buttons (<form action=...) to perform some action (by calling a python script). However, some actions (like 'delete' a picture for example) I would like to warn user before performing it. I recall from php how to pop up a window (or a drop down in Mac OSX) with a warning message prompting a 'Yes' or 'No' confirmation and I was wondering how would I do it with Zope, with an example if possible.
This could be done via a confirmation form served from zope, but it would be easier/cleaner if you used javascript to pop-up the yes/no window and then use javascript to submit the 'delete' form (or not). Jonathan
--On 14. Juni 2007 16:18:11 +0100 Alan <alanwilter@gmail.com> wrote:
Dears,
I have a web page with some buttons (<form action=...) to perform some action (by calling a python script). However, some actions (like 'delete' a picture for example) I would like to warn user before performing it. I recall from php how to pop up a window (or a drop down in Mac OSX) with a warning message prompting a 'Yes' or 'No' confirmation and I was wondering how would I do it with Zope, with an example if possible.
This has basically nothing to do with Zope. Either you use client-side Javascript to ask for confirmation or you submit to dedicated from asking the user for yes/no..that's trivial HTML. -aj
Alan, on 2007-06-14:
Dears,
I have a web page with some buttons (<form action=...) to perform some action (by calling a python script). However, some actions (like 'delete' a picture for example) I would like to warn user before performing it. I recall from php how to pop up a window (or a drop down in Mac OSX) with a warning message prompting a 'Yes' or 'No' confirmation and I was wondering how would I do it with Zope, with an example if possible.
In CMFPlone the 'delete' action leads to the delete_confirmation page template. This asks the user if he is sure that he wants to delete the item. Maybe you can borrow some code from that? See: http://dev.plone.org/plone/browser/CMFPlone/branches/2.5/skins/plone_forms/d... though for some reason nothing is currently visible there. -- Maurits van Rees | http://maurits.vanrees.org/ [NL] Work | http://zestsoftware.nl/ "Do not worry about your difficulties in computers, I can assure you mine are still greater."
I have a web page with some buttons (<form action=...) to perform some action (by calling a python script). However, some actions (like 'delete' a picture for example) I would like to warn user before performing it. I recall from php how to pop up a window (or a drop down in Mac OSX) with a warning message prompting a 'Yes' or 'No' confirmation and I was wondering how would I do it with Zope, with an example if possible. If you've opened pop up window "with php" then in fact it had to be JavaScript. Possibly you're looking form something like:
if (confirm("Do you really want to remove this picture")) return true return false which may be used with onsubmit event of form object. Of course this is javascript code not python. -- Maciej Wisniowski
Thanks you guys, Indeed, I just 'copy & paste' the javascript code from php to my zpt and voilà, it worked. Sorry for bothering you guys with such a simple question, but at first I was wondering zope would have something more interesting, never mind. Many thanks. Cheers, Alan On 14/06/07, Maciej Wisniowski <maciej.wisniowski@coig.katowice.pl> wrote:
I have a web page with some buttons (<form action=...) to perform some action (by calling a python script). However, some actions (like 'delete' a picture for example) I would like to warn user before performing it. I recall from php how to pop up a window (or a drop down in Mac OSX) with a warning message prompting a 'Yes' or 'No' confirmation and I was wondering how would I do it with Zope, with an example if possible. If you've opened pop up window "with php" then in fact it had to be JavaScript. Possibly you're looking form something like:
if (confirm("Do you really want to remove this picture")) return true return false
which may be used with onsubmit event of form object. Of course this is javascript code not python.
-- Maciej Wisniowski
participants (5)
-
Alan -
Andreas Jung -
Jonathan -
Maciej Wisniowski -
Maurits van Rees