Change Content Type
Posted by jackhill - Feb 22 ’13 at 11:32
Is there a way to allow for people to change the content type field? On a native SharePoint edit form, a control is rendered to allow a user to swap from one content type to the next. Is there any way to expose this functionality in SPForms?
-
DmitryAdminMember for: 8 years 8 months 21 days
Hello, Jack,
Currently Forms Designer doesn't support content type changing directly from the edit form. As a workaround, you can create dropdown field with your content types, place it into your form and change content type value based on this field in a simple workflow.
-
DmitryAdminMember for: 8 years 8 months 21 days
Hello, Jack,
We have added required functionality in th last version: 2.6.4840. Download it from our website. Now, you can add Content Type field like any other field and change it in a new or edit form.
-
Jeff ChildersMemberMember for: 7 years 6 months 3 days
[#2]: Can seem to find this option. Where would I find the field for "content type"
-
Jeff ChildersMemberMember for: 7 years 6 months 3 days
[#3]: Let me clarify that I am looking for content type in the edit form of a list, not a document library.
-
Dmitry KozlovAdminMember for: 7 years 5 months 10 days
[#4]: Hi Jeff,
Unfortunately, Content Type field is supported by Forms Designer for SharePoint On-premises only. You can find key differences between Forms Designer editions on the following page:
http://spform.com/documentation/editions-comparison -
craigwat11MemberMember for: 6 years 11 months 23 days
Hi, is it possible to set the content type depending on another field?
I've basically set up a button that when clicked I want it to change the content type - code i'm using is below but it doesn;t work.
fd.field('ContentType').value('value');
ta
-
Dmitry KozlovAdminMember for: 7 years 5 months 10 days
[#6]: Please, try the following code:
// getting the SELECT element var contentType = fd.field('ContentType').control()._el().find('select'); // setting the second type contentType.find('option').eq(1).prop('selected', true); // reloading the form contentType.change();
-
craigwat11MemberMember for: 6 years 11 months 23 days
[#7]: Perfect, thank you for all your help.
-
ds4beMemberMember for: 6 years 3 months 24 days
Hi I am very new to this, can you explain what the 'select', 'option' and 'selected' is referring to? are they CSS Code, internal references, fields or content types?
// getting the SELECT element
var contentType = fd.field('ContentType').control()._el().find('select');
// setting the second type
contentType.find('option').eq(1).prop('selected', true);
// reloading the form
contentType.change(); -
Dmitry KozlovAdminMember for: 7 years 5 months 10 days
[#9]: Hi,
The internal name here is 'ContentType'. 'select', 'option', 'selected' are parts of HTML-code generated by the Content Type field. The code above sets the second option in the drop-down control with the list of available content types.
You can find more info on JQuery and selectors by clicking the links below: