Sunday, 7 July 2013

confirm box in Javascript:

 

 

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs"
Inherits="Test" %>

<!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></title>

    <script type="text/javascript">
        function conformbox() {
            var x;
            var r = confirm("please click any one");
            if (r == true) {
                x = "Ok Continue";
            }
            else {
                x = "cansel";
            }
            document.getElementById("id").innerHTML = x;
        }
</script>
    

</head>
<body>
    <form id="form1" runat="server">
    <div>
    
<input type="button" value="click me" onclick="conformbox()" />
<p id="id" ></P>
    </div>
    </form>
</body>
</html>

No comments:

Post a Comment