Change Content Type

rss

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?

  • Dmitry
    Dmitry
    Admin
    Member for: 7 years 2 months 10 days
    #1 by Dmitry Feb 23 ’13 at 05:17

    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.

  • Dmitry
    Dmitry
    Admin
    Member for: 7 years 2 months 10 days
    #2 by Dmitry Apr 3 ’13 at 11:57

    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 Childers
    Jeff Childers
    Member
    Member for: 5 years 11 months 20 days
    #3 by Jeff Childers Feb 12 ’14 at 10:33

    [#2]: Can seem to find this option.  Where would I find the field for "content type"

  • Jeff Childers
    Jeff Childers
    Member
    Member for: 5 years 11 months 20 days
    #4 by Jeff Childers Feb 12 ’14 at 10:45

    [#3]: Let me clarify that I am looking for content type in the edit form of a list, not a document library.

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 10 months 28 days
    #5 by Dmitry Kozlov Feb 13 ’14 at 02:18

    [#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

  • craigwat11
    Member
    Member for: 5 years 5 months 11 days
    #6 by craigwat11 May 2 ’14 at 08:44

    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 Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 10 months 28 days
    #7 by Dmitry Kozlov May 6 ’14 at 04:30

    [#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(); 
    
  • craigwat11
    Member
    Member for: 5 years 5 months 11 days
    #8 by craigwat11 May 7 ’14 at 03:33

    [#7]: Perfect, thank you for all your help.

  • ds4be
    Member
    Member for: 4 years 9 months 11 days
    #9 by ds4be Nov 8 ’14 at 05:16

    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 Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 10 months 28 days
    #10 by Dmitry Kozlov Nov 10 ’14 at 05:10

    [#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:

    http://jquery.com/

    http://api.jquery.com/category/selectors/

Displaying 1 to 10 of 10 messages