0

I have looked at the related items but all speak of the current user. I need to enter a different user into an input block that functions as a people picker. The reason for my madness is I have a bunch of javascript going on and am using in a new form in a task list. I need to be able to add a new item using javascript. In the form is one simple manager input I must do. Can you please help with how to set up the people picker for this?

Manager: *
0

You can add People picker in a new form and fetch the values from the people picker for submission of item into task list.

you follow this link on how to add and fetch values form the people picker using script.

https://github.com/SharePoint/PnP/blob/master/Components/Core.JQuery/sp.peoplepicker.js.md

  • Suresh you link didn't work. However, what I am looking for is a people picker that works like the one used in SharePoint but as a JavaScript control such as <input id="mine" type="text" /> If I click on the input box, as in the jquery datepicker, a popup with appear giving me a method to select a user name from within the sharepoint relm – Richard Przybylski May 15 '17 at 14:49
  • I am trying to populate the assigned to block in a task list in SharePoint – Richard Przybylski May 15 '17 at 14:50
  • I added the people picker using a jquery solution. It worked perfectly. – Richard Przybylski Mar 30 '18 at 16:40
0

I used this in the new form and it worked great:

  1. Place this code at the end of the standard form:

<meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>jQuery UI Datepicker - Default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"/> <link rel="stylesheet" href="/resources/demos/style.css"/> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script> $( function() { $( &quot;#datepicker&quot; ).datepicker(); $( &quot;#datepicker1&quot; ).datepicker(); } ); </script>

  1. You will need to change the form entry to look like this:

<tr> <th> <nobr>Start Date</nobr> </th> <td class="ms-formbody"> <input type="text" id="datepicker"/> </td> </tr> <tr> <th> <nobr>Due Date</nobr> </th> <td style="vertical-align:top" class="ms-formbody"> <input type="text" id="datepicker1"/> </td> </tr>

  1. The popup date will work flawlessly. It takes a little patience but it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.