I would like to share with you how you could open a form in a dialog in SharePoint.
- Add a Form web part on a page of your choise.
- Replace the code with this:
- Replace sitename and library with the ones in your environment.
- Click Save and OK in the web part and try it out!