Solved

Displaying Confirm Box, while clicking on submit.

Posted on 2003-10-22
2
165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Don't miss ATEN at NAB Show April 24-27!

Visit ATEN at NAB Show to learn how our "Seamlessly Entertaining" solutions deliver fast, precise video streaming without delays for the broadcasting and media environment. ATEN will showcase its 16x16 Modular Matrix Switch (VM1600) and KVM Over IP Solution (KE6900 series).

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Interesting problem when moving between environments 6 57
Service "nameserver" appears to be down 4 664
Forbidden errors 5 156
cookies analysis tools 2 108
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…
What You Need to Know when Searching for a Webhost Provider
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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