RE: [PHP] Confirmation dialog box

From: Date: Mon, 21 Apr 2003 15:52:49 +0000
Subject: RE: [PHP] Confirmation dialog box
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-144656@lists.php.net to get a copy of this message
Hi.. Unless you get into a bit of dialog building to open a window, with a form, to pass data to a script, this is really more of a javascript issue. Javascript provides a function called confirm which returns true/false based on whether ok or cancel is clicked. You can use this in a form, for example. Given a form that deletes an item from a database, your form tag would look like.. <form method="post" action="foo.php" onSubmit="javascript:return confirm('Do you really want to delete this item?);"> In this case the form is only submitted when Ok is pressed/clicked. You cannot, directly, get the value returned from a confirm() in JS, from within your PHP script, since the PHP script runs on the server, before the confirm is ever executed on the client. Hope this helps ? Nicole > -----Original Message----- > From: Tomás Liendo [mailto:tomasjliendo@hotmail.com] > Sent: Monday, April 21, 2003 8:42 AM > To: php-general@lists.php.net > Subject: [PHP] Confirmation dialog box > > > Hello people, a simple question: > > How can I show to the user a confirmation dialog box (with Yes/No buttons) > to confirm an operation? > > Ahead of time, thank you very much, > > Tom. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#144656) next »