Paul Joseph | 30 May 2012 16:28
Picon
Gravatar

ok/cancel prompt followed by submit?

Hi there,

I was wondering how I could do this: prompt the user whether they wish 
to proceed or not.  If they want to, the form is submitted if not, not.

I am using Cocoon 2.1.11 and Flowscript/CForms

So, there are a number of rows that the user can select (highlight) and 
then click a "Delete" button whereupon I submit the row ids and delete 
the rows.  No problem.

The customer has now asked me to put a prompt, to ask the user to 
confirm, before the delete actually happens.  I was thinking of a 
JavaScript confirm box, and triggering it based on the onclick event 
from my Delete button.

But if the users confirms the delete, how do I call the same Delete 
button's submit action?

Paul
Robby Pelssers | 30 May 2012 16:31
Favicon

RE: ok/cancel prompt followed by submit?

Check this example: http://www.shiningstar.net/articles/articles/javascript/confirmsubmit.asp

-----Original Message-----
From: Paul Joseph [mailto:pjoseph <at> gmail.com] 
Sent: Wednesday, May 30, 2012 4:28 PM
To: users <at> cocoon.apache.org
Subject: ok/cancel prompt followed by submit?

Hi there,

I was wondering how I could do this: prompt the user whether they wish 
to proceed or not.  If they want to, the form is submitted if not, not.

I am using Cocoon 2.1.11 and Flowscript/CForms

So, there are a number of rows that the user can select (highlight) and 
then click a "Delete" button whereupon I submit the row ids and delete 
the rows.  No problem.

The customer has now asked me to put a prompt, to ask the user to 
confirm, before the delete actually happens.  I was thinking of a 
JavaScript confirm box, and triggering it based on the onclick event 
from my Delete button.

But if the users confirms the delete, how do I call the same Delete 
button's submit action?

Paul

---------------------------------------------------------------------
(Continue reading)

Gary Larsen | 30 May 2012 17:25

RE: ok/cancel prompt followed by submit?

Hi Paul

What I've done is have the delete button action make visible a group where
the real delete button lives, along with a cancel button which will make the
group invisible again.  Some YUI stuff does the popup with background
disabled.

Gary 

-----Original Message-----
From: Paul Joseph [mailto:pjoseph <at> gmail.com] 
Sent: Wednesday, May 30, 2012 10:28 AM
To: users <at> cocoon.apache.org
Subject: ok/cancel prompt followed by submit?

Hi there,

I was wondering how I could do this: prompt the user whether they wish 
to proceed or not.  If they want to, the form is submitted if not, not.

I am using Cocoon 2.1.11 and Flowscript/CForms

So, there are a number of rows that the user can select (highlight) and 
then click a "Delete" button whereupon I submit the row ids and delete 
the rows.  No problem.

The customer has now asked me to put a prompt, to ask the user to 
confirm, before the delete actually happens.  I was thinking of a 
JavaScript confirm box, and triggering it based on the onclick event 
from my Delete button.
(Continue reading)

Jasha Joachimsthal | 30 May 2012 17:55
Picon
Favicon
Gravatar

Re: ok/cancel prompt followed by submit?

If you really want to be safe, let the form submit to an intermediate page in which you summarise what the user will delete. If the user submits this page, then delete it. This can be done with continuations, no Javascripts are needed. The average user just clicks OK on a confirm window without reading it.


On 30 May 2012 16:28, Paul Joseph <pjoseph <at> gmail.com> wrote:
Hi there,

I was wondering how I could do this: prompt the user whether they wish to proceed or not.  If they want to, the form is submitted if not, not.

I am using Cocoon 2.1.11 and Flowscript/CForms

So, there are a number of rows that the user can select (highlight) and then click a "Delete" button whereupon I submit the row ids and delete the rows.  No problem.

The customer has now asked me to put a prompt, to ask the user to confirm, before the delete actually happens.  I was thinking of a JavaScript confirm box, and triggering it based on the onclick event from my Delete button.

But if the users confirms the delete, how do I call the same Delete button's submit action?

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe <at> cocoon.apache.org
For additional commands, e-mail: users-help <at> cocoon.apache.org


Paul Joseph | 20 Jun 2012 15:10
Picon
Gravatar

Re: ok/cancel prompt followed by submit?

Thanks guys, and sorry for the delay...client had postponed it for a while.

I don't get how to do it without any JavaScript is involved...don't I do a submit with say "delete" as the id and then based on that write some small line of JS to show that page with the button that does the real delete?  How do I do it with just continuations?

Paul


On 5/30/2012 11:55 AM, Jasha Joachimsthal wrote:
If you really want to be safe, let the form submit to an intermediate page in which you summarise what the user will delete. If the user submits this page, then delete it. This can be done with continuations, no Javascripts are needed. The average user just clicks OK on a confirm window without reading it.



On 5/30/2012 11:55 AM, Gary Larson wrote:
Hi Paul What I've done is have the delete button action make visible a group where the real delete button lives, along with a cancel button which will make the group invisible again. Some YUI stuff does the popup with background disabled. Gary
On 30 May 2012 16:28, Paul Joseph <pjoseph <at> gmail.com> wrote:
Hi there,

I was wondering how I could do this: prompt the user whether they wish to proceed or not.  If they want to, the form is submitted if not, not.

I am using Cocoon 2.1.11 and Flowscript/CForms

So, there are a number of rows that the user can select (highlight) and then click a "Delete" button whereupon I submit the row ids and delete the rows.  No problem.

The customer has now asked me to put a prompt, to ask the user to confirm, before the delete actually happens.  I was thinking of a JavaScript confirm box, and triggering it based on the onclick event from my Delete button.

But if the users confirms the delete, how do I call the same Delete button's submit action?

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe <at> cocoon.apache.org
For additional commands, e-mail: users-help <at> cocoon.apache.org





Gmane