PreFill Form Field

rss

Posted by bburke - May 26 ’13 at 09:45

I have two lists, "Pipeline" and "Notes". I am following the blog post http://formsdesigner.blogspot.com/2013/04/sharepoint-2013-form-with-related-items_11.html

I want to prefill the "Pipeline" field in the New Item Notes form with the "Title" field from the "Pipeline" form.

In the Parent (Pipeline) Edit form I enter the following in the js-editor:

// getting query string hash
var queryString = SP.ScriptHelpers.getDocumentQueryPairs();
// adding get-parameter 'order' into new item link
newItem.attr('onclick', 
  'NewItem2(event, "' + newItem.attr('href') + '&Title=' + queryString['ID'] + '"); return false;')

In the (Notes) New Item Form, I enter the following in the js-editor:

// getting query string hash
var queryString = SP.ScriptHelpers.getDocumentQueryPairs();
// fill order number
fd.field('Pipeline').control().value(queryString['Title']);

I see the Title ID in the url when I open the Notes NewItem Form.

But the Title ID in the url is populating the "Title" field in the Notes New Item Form.

Am I doing something wrong?

Displaying 1 to 6 of 6 messages