Display Content Type in New Form in the "PlaceHolderPageTitleinTitleArea"

Feb 11, 2011 at 1:47 PM

Hello Gentlemen,

As requested, I am posting my query from Twitter in  regards to trying to pass the Content Type of an item into the PlaceHolderPageTitleinTitleArea, um, area of a New Form. I can do it easily in the Edit and Display forms using the "ContentType" property, but as stipulated i don't think this property is set for the item until save. However, there is a Content Type ID# in the query string, so the new form knows what fields to pull... how can we convert this info into the Content Type name and display it?

Thanks for any assistance you can render! You guys are always the best.


Feb 11, 2011 at 2:40 PM


It just so happens I got an email last week from someone who wanted to do something very similar, and he gave me the code he used. (This is going to turn into a blog post now!)

You may need help in using this, but here it is; ask more questions!


The following is the message from jenglish:

Marc,  great library!  Thanks for creating it.

I use a lot of content types in my lists and found that I need to apply functionality to specific content types and dealing with the content type IDs sucked.  So I used your library and put together a function to make my life easier.

function SPListContentTypeFromURL(thisList){

var queryStringVals = $().SPServices.SPGetQueryString();
var contentTypeIdValue = queryStringVals["ContentTypeId"];
var contentTypeName = "";

// Get the list's Content Types
 operation: "GetListContentTypes",
 listName: thisList,
 async: false,
 completefunc: function (xData, Status) {
  $(xData.responseXML).find("ContentType").each(function() {
   if($(this).attr("ID") == contentTypeIdValue){
    contentTypeName = $(this).attr("Name");
    return false;
// Return the Name
return contentTypeName;
Feb 11, 2011 at 3:22 PM

More details in my new blog post: http://mdasblog.wordpress.com/2011/02/11/using-spservices-to-get-the-display-names-for-a-sharepoint-lists-content-types/