?
Solved

Displaying Confirm Box, while clicking on submit.

Posted on 2003-10-22
2
Medium Priority
?
167 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 600 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month12 days, 2 hours left to enroll

752 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