Monday 2 February 2015

SharePoint Modal dialog box using spservices

Share it Please
<script type="text/javascript" src="https://Site Collection Url/sites/TestSite/Style Library/Samples/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="https://Site Collection Url/sites/TestSite/Style Library/Samples/jquery.SPServices-2014.02.min.js"></script>


<div style="padding:10px;text-align:center;cursor:pointer;">
<a href="javascript:;" onclick="ModelPopFn();">
<img src="/sites/TestSite/Style%20Library/Samples/Image1.jpg"/>
</a>
</div>

<script>
function ModelPopFn()
{
var EmpListFormUrl = "/sites/TestSite/Lists/Emp/NewForm.aspx";
openmodaldialog(EmpListFormUrl);

}
function openmodaldialog(href)
{
var options = {
url: href,
title: "Create a new Emp Details",
allowMaximize: true,
showClose: true,
width: 750,
height: 450,
dialogReturnValueCallback: function(dialogResult)
        {
        window.location.href=window.location.href;
        }
}
SP.UI.ModalDialog.showModalDialog(options);
}
</script>

No comments:

Post a Comment

Followers

Follow The Author