Friday, 21 September 2012

Jquery Confirmation Dialog


//JavaScript method for showing the dialog box

<script type="text/javascript">
function disclaimerDialogBox() {
var x = $('#disclaimer').dialog({
autoOpen : true,
modal : true,
width : 550,
height : 240,
resizable : false,
zIndex: 5000,
  beforeClose: function(event, ui) {
           if(event.keyCode === 27){
             return false;
           }
        }
});
x.dialog({
buttons : {
"I Accept" : function() {
$(this).dialog('close');
}
}
});
$(".ui-dialog-titlebar").hide();
x.dialog('open');
return true;
}
</script>


//CSS for Dialog and button


<style type="text/css">
        .ui-dialog .ui-dialog-buttonpane {
   text-align: center;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
   float: none;
}
.ui-button-text {
   font-size: 13px; /* Or whatever smaller value works for you. */
}
</style>

//Check for 1st time to show the disclaimer box .


<c:if test="${user.disclaimer}">
<div id="disclaimer" style="display: none;">
<font size="2">
CONFIDENTIALITY NOTICE - GOES HERE
</font>
</div>
</c:if>


//Call the  disclaimerDialogBox() method onLoad of the body

<body onload="uncheckCheckBox();disclaimerDialogBox();">




No comments:

Post a Comment

Thank You for your valuable comment

Difference between class level and object locking and static object lock

1) Class level locking will lock entire class, so no other thread can access any of other synchronized blocks. 2) Object locking will lo...