View Single Post
  #6 (permalink)  
Old July 5th, 2004, 05:43 AM
richard.york's Avatar
richard.york richard.york is offline
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

As Michael pointed out there are several ways to do it. For a form I would use this:

<input type='submit' name='do_action' value='Delete' onclick='javascript: return confirm("Are you sure that you would like to delete the selected records");' />

The onclick event, however can be applied to lots of things. In this case, the onclick event puts out a confirmation dialouge box, which is nothing more than a simple boolean operation. The user clicks OK, the result of the box is TRUE and the form is submitted, if the user clicks CANCEL the result of the box is FALSE and the form is not submitted.

There are general JavaScript forums on P2P too ;) look under the "Web" category and general PHP discussion forums as well, look under "Open Source PHP & Linux".



Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::