If you have a need to open a modal dialog for user interaction, here’s how you can accomplish it the “SharePoint 2010″ way.
To start, create a new javascript function to handle opening the dialog. In the function, an options class will need to be created with the appropriate options for using SP.UI.ModalDialog.showModalDialog(options) method. These include the url, dimensions and any callback operations. There is also a querystring parameter that needs to be added to have SharePoint automatically turn off the “chrome” that is not necessary for a dialog. You can simply add “&IsDlg=1″ to any SharePoint URL and the chrome will be turned off.
Here’s a script I’m using for my current project to open a form allowing users to add comments to an item.
<script type="text/javascript">
function OpenEditDialog(item_title, item_id){
var options = {
url:"http://sp2010dev/SitePages/NewComment.aspx?ItemID=" + item_id + "&title=" + item_title + "&IsDlg=1",
width: 500,
height: 300,
dialogReturnValueCallback: DialogCallback
};
SP.UI.ModalDialog.showModalDialog(options);
}
function DialogCallback(dialogResult, returnValue){ }
</script>
The final step is to simply create a hyperlink or some other method of calling this function.
<a href="#" onclick="OpenEditDialog('Title',14);">Add A Comment</a>

Is there a way that I can show only a part of the list item like if it is a page, I just need to show part of the content on the dialog with a more option
Pingback: Display a NewItem Form in a Modal Dialog in SharePoint 2010 « Drift Bottle
Can I open the Modal Dialog directly via javascript. In my situation, I unfortunately can not host my form in a Web Part. Because i’ll open the form directly from aform library and display in browser to user. But i use an applicationpage, which i want to connect with my infopath.
I’m very grateful if you could give me a tip how I can solve my problem.
Hi,
Thanks for a quick and easy solution!
I’m trying to customise this to open a seperate .aspx page in my site. It’s simply a table of links, however when replacing the URL, the dialog appears, but does not display any content.
Any suggestions?
Found it.
I had to remove the title and other URL parameters and the chrome also.
Thanks again for your excellent solution!
Pingback: SharePoint Daily » Blog Archive » SharePoint & the iPad; Top Cloud Collaboration Apps; Lessons from Cloud Deployment
Pingback: SharePoint & the iPad; Top Cloud Collaboration Apps; Lessons from Cloud Deployment - SharePoint Daily - Bamboo Nation