Friday 1 June 2012

How to open Modal Popup (NewForm.aspx) on image click

If you want to open the NewForm.aspx page of  list/library on click of an image, then you have to follow the below steps:

Step-1: Add a content editor in the page.
Step-2: In HTML source add the below code:

<a href="javascript:var options = {url:'/sitename/Lists/listname/NewForm.aspx?IsDlg=1&ContentTypeId=0x001989BCF16D8914CAF8862B0C6C89E091E', title: 'Popup Title'}; void(SP.UI.ModalDialog.showModalDialog(options))"><img _moz_resizing="true" alt="AddNew.BMP" src="Image Path" style="margin: 5px;"/></a>

Step-3: Save and Close the HTML Source
Step-4: Click on Stop Editing

Its Done

Happy Coding :)

No comments:

Post a Comment