Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Modal Popup - Do Not Trigger if "Cancel" button is clicked

Posted on 2009-03-31
2
Medium Priority
?
267 Views
Last Modified: 2012-05-06
Hi

I have a ModalPopup on my page which is linked to a command button. The button has a onClientClick event which displays a javascript confirm.

What I am trying to do is that when the js confirm appears it only appears when "OK" is clicked and doesn't appear when "Cancel" is clicked

Any ideas

Thanks
0
Comment
Question by:patelajk
  • 2
2 Comments
 
LVL 23

Expert Comment

by:apresto
ID: 24027144
You can do this like this

if ( confirm("Click ok to continue, cancel to return") )
{
    alert("The user clicked OK!");
}
else
{
    alert("The user clicked CANCEL");
}

Open in new window

0
 
LVL 23

Accepted Solution

by:
apresto earned 500 total points
ID: 24027145
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

963 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