Display Title value of Parent list item in connected Newform.aspx list item

Mikello 81 Reputation points
2020-08-03T02:01:32.61+00:00

How can I pass Title value of Parent list item to a connected list webpart item (to same Title field). I am using Display Form in Parent List to display connected webparts.

I am attaching code below in comments for reference.

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,216 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,606 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,573 questions
{count} votes

Accepted answer
  1. Amos Wu-MSFT 4,051 Reputation points
    2020-08-04T08:33:08.667+00:00

    My code idea, if we use the native new item directly, it will be difficult to transfer the title value between the two pages, so I used SP.UI.ModalDialog.showModalDialog().
    Code in parent list display form:parentlistdisplayformcode.txt
    Code in child list new form:childlistnewformcode.txt

    My test result for your reference:
    15501-test33.gif

    Tip:Don't forget to change the url of new from to that of your environment.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Mikello 81 Reputation points
    2020-08-03T13:20:08.153+00:00

    I need help with the script. On the dispform.aspx of Parent List, I have a child list which is connected with Parent list through "Title" field. When I click on New Item of child list, I want to display the Parent "Title" field value in child Newform.aspx.

    0 comments No comments

  2. Mikello 81 Reputation points
    2020-08-04T17:03:08.167+00:00

    @Amos Wu-MSFT I changed URL to child list New form. But when I am on parent list dispform, it is giving me missing semicolon error in debugger. Line 507,9 (attached image in comments). Is there a syntax error in the Parentcode? I am not able to correct it.

    Also both Title fields on Parent and Child is marked as required.