Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

When you create a new document set, you are presented with a modal dialog such as the following:

alt text

I want to have this kind of "New Form" (modal) for my custom content type (with custom form).

Now, I know that I can create my own modal dialogs using the Javascript API (e.g. http://www.chakkaradeep.com/post/Using-the-SharePoint-2010-Modal-Dialog.aspx). Also there is the NewFormUrl property for a content type, where I can redirect the user upon creating a new item from my content type ( http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontenttype.newformurl.aspx) - this is not the same, because I think it is nicer to stay on the same page.

I still don't know how I would get Javascript to fire upon creating a new item from my content type, so I could call the modal dialog api. What I basically want is this:

New > MyContentType > User is presented with a form as in the Screenshot above > User enters some metadata > Item based on MyContentType is created with metadata entered by user.

Also when creating my own content type new form, would I need to recreate everything Microsoft has done so nicely for the Document Set (i.e. Save Button, Check-In, Copy/Paste)?


EDIT: And then there is that: How to Open a List Form in a Modal Dialog Box

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

You should not have to worry about how the dialog launches, it should happen seamlessly from the ribbon new button no matter the content type. I would check two things:

  1. Is the site operating with v4 (sp2010) visual styles?

  2. Is the list configured to show forms in a dialog.

List Settings -> Advanced -> Dialogs -> Launch forms in a dialog? -> Yes

The list forms, NewForm.aspx, DispForm.aspx, EditForm.aspx are all full pages with master page wrappers and everything. SharePoint 2010 magic happens when "Launch forms in a dialog?" is turned on, and only the content of the form is displayed in the dialog.

share|improve this answer
add comment

try this

New Item: javascript:EditItem2(event,"/_layouts/listform.aspx?ListId={YOUR_LIST_ID} &RootFolder=YOUR_ROOT_FOLDER &ContentTypeId=ITEM_CONTENTTYPE_ID");

but check this out http://tuan-tomy.blogspot.com/2010/09/redirect-to-link-to-new-item-with.html

share|improve this answer
    
please add more data than just a link. Links tend to be short lived, so to keep the value of the answer in this site you should paste in the goodies from the link and then keep the link for further details. Thanx –  Anders Rask Jun 9 '11 at 11:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.