Saturday, February 9, 2013

Confirm box in Jquery




Users can close the window only by clicking the Yes button—the standard close button has been removed:

<!DOCTYPE html>
<script src = jquery.js></script>
<script src = jqueryui/js/jquery-ui-1.8.16.custom.min.js></script>
<link rel=stylesheet type=text/css
href=jqueryui/css/smoothness/jquery-ui-1.8.16.custom.css />
<div id="dialog" title="Window title">
<p> Would you like to close the dialog box?</p>
</div>
<script>
$("div#dialog").dialog ({
buttons : {
"Yes" : function ()
{
   $("div#dialog").dialog ("close");
},
   "No" : function ()
{
}
}
}).prev().find(".ui-dialog-titlebar-close").hide ();
</script>

No comments:
Write comments
Recommended Posts × +