---------- Initial Header -----------
>From : "Jason Johnston" [EMAIL PROTECTED]
To : [email protected]
Cc :
Date : Mon, 30 Jan 2006 08:14:23 -0700
Subject : Re: CForm: ask for confirm
> Angelo Immediata wrote:
> > Hi all. I have this scenario: in my application a web user can delete
> > something. I'ld like to ask for confirm before to delete what he has
> > choosen. I can't use javascript like "window.open...." etc... Is
> > there a method to ask this thing to the user with no using
> > Javascript? I'ld like to use something like a "special widget or
> > attribute" that i can use only when the user wants to delete and i
> > don't want to change current page but reload it by asking this
> > confirm.
> >
> > I'm using Cocoon 2.1.7 and its portal block.
>
> If I understand what you're looking for, you want a way to ask for a
> user's confirmation without using client-side javascript. I've done
> this in the past by creating a simple confirm() flowscript function
> which roughly mimics the behavior of the confirm() function in
> client-side browser javascript. So when I get to a point in my
> flowscript where I want the user to choose whether or not to do
> something, all I have to do is:
>
> if(confirm("Are you sure you want to delete this item?")) {
> performDelete();
> }
> else {
> //redisplay form or whatever the fallback action is
> }
>
> The confirm function looks something like this:
>
> // ask the user for yes/no confirmation, returns a boolean:
> function confirm(question) {
> cocoon.sendPageAndWait("confirm.jx", {question:question});
> return (cocoon.request.getParameter("confirm") == "Yes");
> }
>
> The confirm.jx template looks something like this:
>
> <html>
> ...
> <form action="${cocoon.continuation.id}.continue">
> <p>${question}</p>
> <p>
> <input type="submit" name="confirm" value="No" />
> <input type="submit" name="confirm" value="Yes" />
> </p>
> </form>
> ...
> </html>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
Hi. Thanks for your replay... i need just this thing.... i have not thought to
this simple solution.... thanks again
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]