I'm trying to create a model dialog in jquery. I would like for my button to open up the dialog. Currently as soon as it opens it up it also closes it. I never tell it to close it but when i click the button it opens and then immediately closes. Any idea why?
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://jquery-ui. googlecode.com/svn/tags/latest/external/jquery. bgiframe-2.1.2.js" type="text/javascript"></script>
<script src="http://jquery-ui. googlecode.com/svn/tags/latest/ui/minified/i18n/jquery-ui-i18n.min.js" type="text/javascript"></script>
<asp:Button ID="rejctbutton" runat="server" Text="Reject" />
<div id="rejectiondiv">
<h3>
Reason of Rejection for Insurance Claim
</h3>
<h4>
This will email the borrower the reason for the rejection.
</h4>
<asp:Label ID="rejectLabel" runat="server" Text="Reason"></asp:Label>
<asp:TextBox ID="rejectTB" runat="server"></asp:TextBox>
</div>
<script type="text/javascript">
$("#rejectiondiv").dialog({ autoOpen: false, modal: true })
$("#rejctbutton")
.button()
.click(function () {
$("#rejectiondiv").dialog("open");
});
</script>
</form>
</body>
</html>