Solved

Displaying Confirm Box, while clicking on submit.

Posted on 2003-10-22
2
161 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

705 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

18 Experts available now in Live!

Get 1:1 Help Now