Monday, August 22, 2016

Dialog box in Visualforce page


Dialog box in VF page

If we need to show any alert to display in vf page, instead of using window.alert() which is with traditional look and feel, we can use dialog box using below script.

<apex:page >
<script type="text/javascript">
document.body.style.cursor="auto";
var box=new SimpleDialog("This is my alert", true);
box.setTitle("Please initiate call to case contact");
box.createDialog();
    box.setContentInnerHTML("<input type=\"button\" value=\"Ok\"  onclick=\"javascript:box.hide();\"/>");
box.show();
</script>
</apex:page>

No comments:

Post a Comment