Error when saving new form

rss

Posted by Exp.AB - Jan 27 ’17 at 08:30

Hi guys.

My version is 3.0.8.

I have a simple new form that only contains three fields: Title, Lookup field, HTML.

This will be the child list for a parent list, I am following this blog: http://formsdesigner.blogspot.is/2016/05/creating-related-items-on-new-item-form.html

I have put in the code in the JS, and the html code in the html field. When the CDATA is TRUE then I can save my form. If the CDATA is FALSE (in the blog it says CDATA=false) I get an error when saving the form.

Can you tell me why this error is happening?

-------------------------

This is the error:

System.Xml.XmlException: '__designer' is an unexpected token. Expecting white space. Line 30, position 105.
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
at System.Xml.Linq.XElement.ReadElementFrom(XmlReader r, LoadOptions o)
at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
at HQnqIWpqg5aFHCboLJ.U44DQi4oiTrlBd6HYL.FyXauyg8ON(SPLimitedWebPartManager  , String  , Forms  , XDocument  )
at a3TEBbRGCZhtP1NwLr.f3iM7Jkhq3kcKyJSsl.CKIzpBgfo(Guid  , Forms  , XDocument  )
at a3TEBbRGCZhtP1NwLr.f3iM7Jkhq3kcKyJSsl.VpJ9lPpdl(Guid  , Forms  , XDocument  )
at FormsDesigner.Sharepoint.FDService.PublishForms(Guid listId, String contentTypeId, Guid groupId, Forms forms, String layout, ServiceFault& fault)

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 21 days
    #1 by Dmitry Kozlov Jan 30 ’17 at 03:15

    Hi,

    Could you provide content of your HTML-field?

  • Exp.AB
    Member
    Member for: 2 years 10 months 13 days
    #2 by Exp.AB Jan 31 ’17 at 07:59

    Hi smile

    Yes the html field contains the code you supply in the blog I mentioned:
    http://formsdesigner.blogspot.is/2016/05/creating-related-items-on-new-item-form.html

    The html code is:
    <div id="_fd_parent_temp">

    <asp:HiddenField runat="server" ID="_fd_parent_tempField" __designer:bind="{ddwrt:DataBind('i','_fd_parent_tempField','Value','Load','ID',ddwrt:EscapeDelims(string(@ID)),'@_fd_parent_temp')}" /> </div>
  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 21 days
    #3 by Dmitry Kozlov Jan 31 ’17 at 08:16

    [#2]: I have tested the code in both Forms Designer for SP on-premises and online, both were saved properly. Could you export the form into a file (use Export button in the ribbon of Forms Designer) and send it to [email protected] What's your SharePoint edition?

  • Exp.AB
    Member
    Member for: 2 years 10 months 13 days
    #4 by Exp.AB Jan 31 ’17 at 09:35

    [#3]: Hi, I have sent an email with all information and screenshots smile

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 21 days
    #5 by Dmitry Kozlov Feb 1 ’17 at 02:38

    [#4]: Hi,

    You missed a space between ID and __designer:bind attributes. The code must be:

    <div id="_fd_parent_temp">
    <asp:HiddenField runat="server" ID="_fd_parent_tempField" __designer:bind="{ddwrt:DataBind('i','_fd_parent_tempField','Value','Load','ID',ddwrt:EscapeDelims(string(@ID)),'@_fd_parent_temp')}" />
    </div>
  • Exp.AB
    Member
    Member for: 2 years 10 months 13 days
    #6 by Exp.AB Feb 1 ’17 at 05:48

    [#5]: Thank you Dimitri, I thought I had done a copy paste on the code, sorry for this.

    I can now save the new form in the designer.

     

    Another issue is happening when creating parent item with child item.

    • I create a parent item, with new form.
    • In the parent new form, I create a child item, fill the child form and hit save.
    • When returning to the parent new form, there is no child item visible in the parent form. Even though I  have set the view to display new items (as told in the blog).
    • But I save the parent new form.
    • Open up the child list and see the chld item I just created but it has no parent ID in the lookup column that I created as described in the blog.

    Am I missing something obvious? I have followed the blog step by step, over and over again without results.

    I have screenshots that I have sent you in an email smile

    Kind regards AB.

     

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 21 days
    #7 by Dmitry Kozlov Feb 1 ’17 at 05:53

    [#6]: You missed $ in the JS-code in the child form. Must be:

    $('#_fd_parent_temp > input').val(window.top.fd._tempParentId());

Displaying 1 to 7 of 7 messages