Solved

Displaying Confirm Box, while clicking on submit.

Posted on 2003-10-22
2
162 Views
Last Modified: 2013-12-24
i have 2 submit buttons in a single form (eg:"delete" and "changeStatus") .
The form reloads the same page .
i use
 <cfif isdefined ("delete")>     and   <cfif isdefined ("changeStatus")>
          blah blah                               blah blah          
          </cfif>                                 </cfif>
                  to distinguish the 2 submits and do the nevessary process for each. Thats is fine.

WHAT I WANT TO DO:

i want to display a confirm message box, when i click on the DELETE Submit button. and only then process for "delete" if i click on "yes"
i am trying to do so in java script. But i am having some problems.

Please Help me by attaching a snippet
0
Comment
Question by:suda5181
2 Comments
 
LVL 2

Accepted Solution

by:
jonnygo55 earned 150 total points
ID: 9601793
in your submit button put  onClick="return confirmDelete()"

your javascript:

function confirmDelete()
{
   if (confirmDelete()){
        var agree=confirm("Submitting will delete.  Do you want to continue?");
      if (agree){
             return true;
      }else{
             return false;
                }
     }
}
0
 
LVL 11

Expert Comment

by:hart
ID: 9604419
that should do it, it can be written in many ways.
but the basic idea would be that of jonny's

Regards
Hart

0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
file too large for website 6 67
cloud web Service looking for a home... 3 100
UPLOAD FILE TO Web API USING POST 5 103
WEB Farm 6 60
A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now