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

I'm working on a SharePoint List that employs multiple Content Types. I would like to add a jQuery floating-draggable DIV containing information specific for each Content Type. I have successfully added such a DIV to a custom NewForm.aspx, however, adding that same functionality to a Content Type has me stumped. Here's my question:

How can I customize a Content Type with the aforementioned DIV so that each Content Type displays information specific to it?

Thanks in advance for any help with these issues,

Arnold

share|improve this question
    
Where do you want it to be enabled ? On the DispForm, on the list, on the content type settings ? –  Sébastien Levert Nov 22 '10 at 18:42
    
Hi Sebastien, The DIV needs to be visible when a Content Type is clicked and a NewForm.aspx is displayed with all the base fields plus fields unique to the Content Type. I'm relatively new to SP and so am learning the technical terms. Thanks, Arnold –  user1743 Nov 22 '10 at 18:59
add comment

1 Answer

up vote 0 down vote accepted

You could, with jQuery, on the selection of the right content type, display the necessary information. You have two options :

  1. You could attach an event to the "New" menu with javascript and jQuery to be able to display your div on the selected of the menu.
  2. You could, on the load of the NewForm.aspx page, test which ContentType is selected and show the necessary information.

Would that be enough for you?

share|improve this answer
    
Sebastien, I'd like to pursue the second option. When I click New and then a Content Type, in the URL I see a ContentTypeId, like so: ContentTypeId=0x01001E6FDB7A46405043BD12AAF7E43E6D1A00C1F2F7A372CFF8478C5413CC15‌​11FE5B I'm guessing that this would the the string I would need to check. Where in NewForm.aspx do I put this code? I'm thinking I can place all the DIVs, one for each Content Type in NewForm.aspx. Then when the form is loaded - Document.Ready - make visible the appropriate DIV. Is this more or less what you're suggesting? Thanks, Arnold –  user1743 Nov 22 '10 at 20:43
    
Exactly! You could create your own NewForm.aspx and then include this code into that new page. –  Sébastien Levert Nov 23 '10 at 16:10
add comment

Your Answer

 
discard

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