Hide "Content Type" field on EditForm.aspx

Sep 21, 2010 at 6:41 PM

Can jPoint be used to hide the "Content Type" field on the EditForm.aspx?

I can get it to work on just about every field but the "Content Type" field.

Any assistance would be greatly appreciated.

Coordinator
Oct 7, 2010 at 4:59 AM

There's a bug in jPoint that it currently does not parse and recognize the "Content Type" field correctly. 

As a workaround, you can also reference the field by order.  In this case, since it is the first field on the edit form hide it by using the follow code

jP.Form.Items[0].hide();
Oct 13, 2010 at 1:57 PM
Edited Oct 13, 2010 at 5:32 PM

Ken,

Thanks for the reply.  I tried:

jP.Form.Items[0].hide();

but it did not work.

Apparently, "Content Type" is not a member of Items.  Items[0] hides the first field below "Content Type" :(

I plugged jPFormInspector.js into my form and "Content Type" shows up as the zero element of jP.Form.Schema.

Any way to hide it using jP.Form.Schema??

If you have any other ideas, please post them.

Thanks,

Dave

PS -jPFormInspector.js is really slick. 
Coordinator
Oct 15, 2010 at 5:28 PM

Dave,

Can you send what you see in jP.Form.Items and jP.Form.Schema?

 

Coordinator
Oct 21, 2010 at 3:51 PM

If your list is on the root site, try

jP.Form.readForm("/"); //add before any other reference to jP.Form to initialize object with list information
//Reference Content Type field with 
var jpfield = jP.Form.Items[0]; //get jpoint field
var opt = $(jP.Form.Items[0].ItemRow).find("select option:selected"); //get select option
var value = opt.val(); //get id of content type
var disptext = opt.text(); //opt.html(); //displayed text