Implement Confirmation Dialog Box Using Javascript

01 Mar 2018 Kamal Pratap
1 Comments 2560 Views

Sometimes we need to display confirmation dialog box to perform any task. Here we explain how to use confirmation popup using java script on button event.


It is a right way to display a alert message before doing any activity.

<html xmlns="">
<head runat="server">
    <title>Confirmation Dialog Box Using Javascript</title>
    <form id="form1" runat="server">
        <script type="text/javascript">
            function ConfirmationBox() {
                var Yes = confirm("User want's to continue..?");
                var check = new Boolean(Yes);
                if (check == true) {
                    alert('want to continue Yes');
                    return true;
                else {
                    alert('user dont continue');
                    return false;
            <input type="button" value="Click Me" onclick="ConfirmationBox();" />


Kamal Pratap

I have 6+ years experience in .Net technologies like Asp.Net, C#, WCF, Web Services, SQL Server, Ajax, LinQ. Currently I am working in Netcarrots Loyalty Services as a Software Developer.


No coments found to display!

Leave a Comment