Yes No Confirmation Box using JavaScript in ASP.Net

Last Reply one year ago By kalpesh

Posted one year ago

 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Post.aspx.vb" Inherits="Forms_Post" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>POST BOOKS </title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <script type = "text/javascript">
        function Confirm() {
            var confirm_value = document.createElement("INPUT");
            confirm_value.type = "hidden";
            confirm_value.name = "confirm_value";
            if (confirm("ARE SURE YOU WANT TO POST THESE BOOKS NOW?")) {
                confirm_value.value = "Yes";
            } else {
                confirm_value.value = "No";
            }
            document.forms[0].appendChild(confirm_value);
        }
    </script>
           <script type = "text/javascript">
    function askConfirm(msg)
{      alert(msg)
      }
 </script>
    </div>
    <asp:Button ID="Button1" runat="server" OnClick="OnConfirm" Text="PostBooks" OnClientClick="Confirm()" 
        style="top: 83px; left: 475px; position: absolute; width: 87px; height: 32px" 
         />
    <asp:Label ID="Label1" runat="server" 
        style="font-weight: 700; font-family: 'MS Gothic'" 
        Text="N.B Posting this information will update the books you have in stock  and it will help you to have up to date library reports.eg Total number of books,Total of lost books etc"></asp:Label>
    </form>
</body>
</html>

 

This question does not have replies marked as Answer.