Sharepoint 2013 Setting people picker with Jquery not working in IE8

In a SharePoint 2013 list with a people picker column labeled Name the following code works great in IE9 and IE10, however in IE8 the script shows an undefined is null or not an object error message at spPeoplePicker.AddUnresolvedUserFromEditor(true);
FYI using jquery min 1.10.2
Any ideas on how to resolve the issue?
<script type="text/javascript">
$(document).ready(function () {
var userid = _spPageContextInfo.userId;
//alert(userid)
function GetCurrentUser() {
var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/getuserbyid(" + userid + ")";
var requestHeaders = { "accept" : "application/json;odata=verbose" };
$.ajax({
url : requestUri,
contentType : "application/json;odata=verbose",
headers : requestHeaders,
success : onSuccess,
error : onError
function onSuccess(data, request){
var userName = data.d.Title;
//set following "field" as column to set in people picker
SetUserFieldValue("Name",userName);
function onError(error) {
//alert(error);
function SetUserFieldValue(fieldName, userName) {
var controlName = fieldName;
var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + controlName + "']");
var peoplePickerEditor = peoplePickerDiv.find("[title='" + controlName + "']");
var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
//comment out this field if edit form needs to be read only
peoplePickerEditor.val(userName);
//comment out this field if edit form needs to be read only
spPeoplePicker.AddUnresolvedUserFromEditor(true);
//disable the field
spPeoplePicker.SetEnabledState(false);
//hide the delete/remove use image from the people picker
$('.sp-peoplepicker-delImage').css('display','none');
GetCurrentUser();
</script>

Hi David,
Below is the complete code I have used to load the current user to the people picker in SharePoint 2013.
$(document).ready(function(){
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', LoadCurrentUser);
function LoadCurrentUser() {
var context = SP.ClientContext.get_current();
var siteColl = context.get_site();
var web = siteColl.get_rootWeb();
this._currentUser = web.get_currentUser();
context.load(this._currentUser);
context.executeQueryAsync(Function.createDelegate(this, SetPickersToCurrentUser), Function.createDelegate(this, LoadUserfailed));
function LoadUserfailed() {
alert('failed');
function SetPickersToCurrentUser()
var loginName = this._currentUser.get_title();
SetPeoplePicker('Order Team', loginName);
function SetPeoplePicker(fieldName, userAccountName) {
var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + fieldName + "']");
var peoplePickerEditor = peoplePickerDiv.find("[title='" + fieldName + "']");
var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
peoplePickerEditor.val(userAccountName);
spPeoplePicker.AddUnresolvedUserFromEditor(true);
Let me know if you have any questions. I will help you out!
-Praveen.
ASP.NET and SharePoint developer
Blog: http://praveenbattula.blogspot.com
Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you.

Similar Messages

  • Sharepoint 2013 list view quick edit does not work with out remote API permissions

    sharepoint 2013 list view quick edit does not work with out remote API permissions.
    When I give Use Remote Interfaces  -  Use SOAP, Web DAV, the Client Object Model or SharePoint Designer interfaces to access the Web site it works which is not an ideal situation..
    MCTS Sharepoint 2010, MCAD dotnet, MCPDEA, SharePoint Lead

    This is true. If you use Fiddler to watch the requests from the list view quick edit you can see CSOM calls. For example when changing a value in a cell, when you tab out you will see the SetFieldValue and Update method calls on the list item.
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • General search form with JQuery not working

    Hi,
    I tried to use jquery to submit a search form because I need some checking before submit. However,  it did not go to search results page, but went to home page instead.
    Here is my html:
    <form name="catsearchform96767" id="generalSearchForm" method="post">
        <p><label style="opacity: 1;" for="f-search">Search</label> <input type="text" name="CAT_Search" id="f-search" /> <button type="submit">GO</button></p>
    </form>
    Javascript:
    $('#generalSearchForm').submit(function(){
         $(this).attr('action', '/Default.aspx?SiteSearchID=1060&amp;ID=/search-results');
         $(this).unbind().submit();
         return false;                                         
    It does not work with JQuery. But when I moved form action url from jquery to html, it worked. Any ideas? Cheers.

    Hi David,
    Below is the complete code I have used to load the current user to the people picker in SharePoint 2013.
    $(document).ready(function(){
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', LoadCurrentUser);
    function LoadCurrentUser() {
    var context = SP.ClientContext.get_current();
    var siteColl = context.get_site();
    var web = siteColl.get_rootWeb();
    this._currentUser = web.get_currentUser();
    context.load(this._currentUser);
    context.executeQueryAsync(Function.createDelegate(this, SetPickersToCurrentUser), Function.createDelegate(this, LoadUserfailed));
    function LoadUserfailed() {
    alert('failed');
    function SetPickersToCurrentUser()
    var loginName = this._currentUser.get_title();
    SetPeoplePicker('Order Team', loginName);
    function SetPeoplePicker(fieldName, userAccountName) {
    var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + fieldName + "']");
    var peoplePickerEditor = peoplePickerDiv.find("[title='" + fieldName + "']");
    var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
    peoplePickerEditor.val(userAccountName);
    spPeoplePicker.AddUnresolvedUserFromEditor(true);
    Let me know if you have any questions. I will help you out!
    -Praveen.
    ASP.NET and SharePoint developer
    Blog: http://praveenbattula.blogspot.com
    Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you.

  • Sharepoint 2013 - Share site invitation email does not work?

    Hi,
    Recently upgraded to SharePoint 2013, but the share website / invitation feature does not work.  From the server I can telnet over port 25.  The AV is not blocking, nor the Firewall.  The IP is allowed over HubRelay for Exchange.
    I've been through this article: 
    http://technet.microsoft.com/en-gb/library/cc263462.aspx#section2
    Any ideas?  Thanks, Matt.

    Yes, where is it? At least give full explanation before marking your answer as answer by yourself.
    Adit

  • Sharepoint 2013, event receiver to rename files not working

    I coded an event receiver (ItemAdding) that renames for example a .txt file to a .text file (it does not matter the extensions, it is just an example). In my code what I do is to an SPFile.MoveTo operation. It works fine in SP2010 but when I execute
    the same code in SP 2013, when the operation is done using IE I get the text "Sorry, something went wrong" and then "File Not Found".
    In the logs this is what I see:
    12/23/2013 15:48:49.16  w3wp.exe (0x17B0)                        0x0AC8 SharePoint Foundation        
     General                        ai1wu Medium   System.IO.FileNotFoundException: The system cannot find the file specified.
    (Exception from HRESULT: 0x80070002), StackTrace:    at Microsoft.SharePoint.SPWeb.GetFileOrFolderProperties(String strUrl, ListDocsFlags listDocsFlags, Boolean throwException, SPBasePermissions& permMask)     at Microsoft.SharePoint.SPFile.PropertiesCore(Boolean
    throwException)     at Microsoft.SharePoint.SPFile.get_Length()     at Microsoft.Office.RecordsManagement.PolicyFeatures.ApplicationPages.UploadPage.OnSubmit(Object o, EventArgs e)     at Microsoft.Office.RecordsManagement.PolicyFeatures.ApplicationPages.UploadExPage.OnSubmit(Object
    o, EventArgs e)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessReque... f72b639c-77b1-5045-c3a2-b23f24ae71c0
    It's clear that the Sharepoint upload code tries to do things with the original name and it does not realize that it was renamed.
    Can I do something from my event receiver code like using the AfterProperties to bypass this error?
    Thanks

    Hi Dennis,
    The issue still persists. Here is the code:
            public override void ItemAdded(SPItemEventProperties properties)
                SPSecurity.RunWithElevatedPrivileges(delegate()
                    try
                        OutputDebugStringA("Inside ItemAdded");
                        string szHttpUrl = properties.WebUrl + "/" + properties.AfterUrl;
                        SPWeb openedWeb = properties.Web.Site.OpenWeb(properties.Web.ID);
                        SPFile spf = openedWeb.GetFile(szHttpUrl);
                        EventFiringEnabled = false;
                        string szUrl = properties.AfterUrl;
                        szUrl = szUrl + ".renamed";
                        string szNewFileName;
                        if (szUrl.LastIndexOf('\\') != -1) szNewFileName = szUrl.Substring(szUrl.LastIndexOf('\\') + 1);
                        else if (szUrl.LastIndexOf('/') != -1) szNewFileName = szUrl.Substring(szUrl.LastIndexOf('/') + 1);
                        else szNewFileName = szUrl;
                        if (properties.ListItem != null)
                            properties.ListItem["Title"] = szNewFileName;
                            properties.ListItem.Update();
                        spf.MoveTo(szUrl);
                        EventFiringEnabled = true;
                        base.ItemAdded(properties);
                        OutputDebugStringA("Renaming to " + szUrl);
                    catch (System.Exception exception)
                        OutputDebugStringA("ItemAdded ERROR: " + exception.ToString());

  • Sharepoint 2013 webDAV PROPPATCH fails with status code 409 error every time when trying to set custom property.

    Sharepoint 2013 webDAV PROPPATCH fails with status code 409 error every time, when trying to set custom property.
    anyone have any idea

    Hi
    Stumbled upon the resolution myself. The Bean Area item needs to be set to Visible=Yes in the property palette for the bean within Forms Builder, and also the implementation class also in the bean's properties must match exactly the package & class name specified in the PJC (my full implementation class string had to be set to oracle.forms.demos.runApplication).
    As this bean has no user interface component, and since the Visible property has to be set to Yes, to avoid having a random square shape for the bean sitting on the form's canvas, I also set the Width and Height properties for the bean to 0.001. This does show a very small dot on the form, but that will be acceptable.
    So in summary there has been a change for PJC / Bean Areas between 6i and 10g Forms, in 6i you could have the Bean Item to be set Visible=No, and the SET_CUSTOM_ PROPERTY built-in would work, however in 10g Forms the Bean Item must be set to Visible=Yes for the SET_CUSTOM_PROPERTY built-in to work.
    Daryl

  • SharePoint 2013 on-premises integration with third party email account

    the Email sending issue from SharePoint is causing too much time waste 
    First let me explain how our SharePoint is deployed
    Sharepoint version : 2013
    Deployment type : on-premise
    Authentication : from Domain controller also hosted locally 
    domain name ; say domain.com this domain.com is same as our website address hosted on godaddy
    SharePoint computer name on local DNS :  sharepoint.domain.com
    OS and IIS : 2008 r2 , IIS 7.5 
    Network firewall : 25 26 ports  opened for sharepoint , both incoming and outgoing.
    Server firewall : turned off
    Email configuration Attempts by IIS 6.0 
    We tried following setting on IIS 6.0 SMTP local server properties
    In General tab
    qualified name was shown as : sharepoint.dts-solution.com
    IP assigned : sharepoint server IP  , advanced putted two entries of IP with ports as 25,26
    In Access tab
    Authentication : selected as Anonymous 
    Connection : All except below list : empty list
    Relay : only the list below , one entry as 127.0.0.1 and other is local static IP of SharePoint server
    in Delivery tab
    outbound security : Basic authentication : accessed user in AD and given the right password, also checked with annonymous -not working 
    outbound connection: all default values and port = 25
    Advance : fully qualified domain name = sharepoint.domain.com , DNS test showed success, rest every check box unchecked 
    On sharepoint central management settings
    Outbound email = sharepoint.domain.com
    from and reply to address = [email protected] 
    IIS 7.5 SMTP settings 
    In IIS 7.5 sharepoint application we added SMTP settings as smtp server = godaddy out going smtp , user name as [email protected] , password = godaddy password , port : godaddy outgoing port  .
    Godaddy account 
    Our website hosted on godaddy with same name as domain.com
    open relay not possible on emails.
    Results
    After setting alerts on SharePoint sites and assigning tasks with alerts we receive email in queue folder but they never get forwarded. We just wish to use any of our email *.domain.com to send outgoing emails from SharePoint . Its been a while we have no
    success. 
    Tech Learner

    Hi,
    As I understand, you are using SharePoint 2013 integrating with third party SMTP server which provides email function.
    From SharePoint side, I'd suggest you refer to the link below to configure email integration:
    http://technet.microsoft.com/en-us/library/ee956941(v=office.15).aspx
    If you have already confirm that message is sent from SharePoint, while stuck in queue on SMTP server, then the issue might be related to relay on SMTP server. Since the issue is related to third party product, we do not have enough resource here,
    I'd recommend you contact their support engineer for more assistance:
    https://support.godaddy.com/help/category/154/email
    https://support.godaddy.com/help/article/3552/managing-your-email-account-smtp-relays
    Thanks for the understanding.
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • Need to bind people picker with group members in AD in office 365 using Client object model in javascript

    Hi,
    I need to create a form in SharePoint designer so that it can display and save selected users. Users should be selected for particular group. Group and users are in AD. Form would look like below:-
    Group1                            People picker with users of Group1 only
    Group2                            
    People picker with users of Group2 only
    Save button to save this mapping in some List for selected users and groups
    I need to do this using CSOM/Javascript in office 365.
    Thanks a lot!
    Arvind
    arvind chamoli

    Hi Venu,
    check those options
    http://www.thesharepointblog.net/Lists/Posts/Post.aspx?List=815f255a-d0ef-4258-be2a-28487dc9975c&ID=135
    http://paultavares.wordpress.com/2012/04/28/sharepoint-ui-widgets-upload-and-pickusers/
    http://spservices.codeplex.com/wikipage?title=Users%20and%20Groups&referringTitle=%24%28%29.SPServices
    http://spservices.codeplex.com/wikipage?title=UserProfileService&referringTitle=%24%28%29.SPServices
    http://blog.vgrem.com/2013/03/27/different-ways-of-extending-people-editor-in-the-client-side-sharepoint-2010/
    this one for 2013 but worth that u check it
    http://msdn.microsoft.com/en-us/library/office/jj713593(v=office.14).aspx
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation. Please remember to mark the reply as answer if it helps.

  • Sharepoint 2013 Active Directory Import- Manager field not updating

    Hi,
      SharePoint 2013 Active directory import  -Manager field not updating
    Concern/Issue-
     We are using SharePoint and configured the Active Directory Import .First import it seems everything is working fine and OOB Organization chart  built using User profile data is coming out right.
    Now the user is moved from one Organization Unit to Another.
    Now our Manager field is not Updating .There is change in AD manager attribute but not reflecting in the SharePoint User profile.
    Manger field is mapped to "manager" attribute in SharePoint.
    We tried removing the user and Re-Import using Incremental import but no luck.
    Thanks for help in advance
    Sachin

    Moving a user from one OU to another in AD won't normally change the Manager attribute in AD.  You would need to edit the user's organization settings to change the manager value in AD.  I've also seen these changes not be picked up unless something
    other than just the manager field in AD changing.  Try changing something like Office location and see if the manager change is picked up by AD Import.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Adding Custom Breadcrumb for SharePoint 2013 Custom Master-Page With A Custom Separator.

    Hi All,
    I have successfully converted an HTML file to a SharePoint 2013 Custom Master-Page with relevant style sheets. But when I used within the SharePoint site I could not find the breadcrumb. So I want to know how to do that? For that breadcrumb I need a custom
    separator like an arrow like in the below.
    As you can see the separator is a custom built one. To have this custom separator in my HTML I have used the following code snippet.
    <div class="breadcrumb-desktop">
    <span class="breadcrumb-links"><a href="#">SharePoint Site Home</a></span>
    <span class="breadcrumb-links"><a href="#">Sub Link 01</a></span> Active Page
    </div>
    The styles are as like in the below.
    .breadcrumb-desktop {
    width: 100%;
    font-family: Arial;
    padding: 23px 0 40px;
    float: left;
    font-size: 0.75em;
    line-height: 1.25;
    .breadcrumb-desktop > span.breadcrumb-links:after {
    content: " \203A ";
    white-space: pre;
    I have tried the following code snippet within the SharePoint site as
    <!--MS:<asp:sitemappath runat="server" sitemapproviders="SPSiteMapProvider,SPXmlContentMapProvider" rendercurrentnodeaslink="false" hideinteriorrootnodes="true">-->
    <!--ME:</asp:sitemappath>-->
    But it did not display as I wanted.
    So how am I supposed to insert these to my Custom Master-Page's breadcrumb and style them? Please could someone help me to solve this?
    Thanks and regards,
    Chiranthaka

    Hi Chiranthaka,
    Please use the following code snippet in your html master page.
    <div class="CustomBreadcrumbs">
    You are here:
    <!--SPM:<SharePoint:AjaxDelta id="DeltaPlaceHolderPageTitleInTitleArea" runat="server">-->
    <!--SPM:<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">-->
    <!--MS:<asp:sitemappath runat="server" sitemapproviders="SPSiteMapProvider,SPXmlContentMapProvider" rendercurrentnodeaslink="false" hideinteriorrootnodes="true">-->
    <!--ME:</asp:sitemappath>-->
    <!--SPM:</asp:ContentPlaceHolder>-->
    <!--SPM:</SharePoint:AjaxDelta>-->
    </div>
    Here is a thread for your reference:
    https://social.msdn.microsoft.com/Forums/office/en-US/daabd903-df98-41da-80d8-6a942d06980e/add-breadcrumb-to-custom-master-page-html-file?forum=sharepointcustomization
    We can also customize a breadcrumb control, then add it in master page.
    http://msreddysharepoint.blogspot.com/2013/01/custom-breadcrumb-navigation-in.html
    Best Regards
    Dennis Guo
    TechNet Community Support

  • After Security updation of Windows 7 in Boot Camp (Mac Book Pro with Retina Display) on 13-Nov-2013, Windows 7 Desktop Gadgets are not working properly.

    After Security updation of Windows 7 in Boot Camp (Mac Book Pro with Retina Display) on 13-Nov-2013, Windows 7 Desktop Gadgets are not working properly.
    This is boot camp problem, because in other normal notebooks (e.g. SONY VAIO, Lenovo with Windows 7) the gadgets are working normally.
    I am attaching the screen shot of Desktop Gadgets and Security updates of Windows 7.
    Kindly solve this issue ASAP.
    Shailendra Gupta
    <edited by host>

    You are not addressing Apple, but a community of unpaid volunteers. So ASAP won't cut it. Also, you should refrain from posting personal information (like your email address) in the body of your comments, as this is part of the community usage guidelines.
    Have you reinstalled the latest Boot Camp Windows 7 drivers, just in case Microsoft overwrote some of them during the Windows 7 security update?
    If you want to communicate issues with Apple about Boot Camp and OS X, click on the link. Just don't hold your breath on receiving a response.

  • Display an XML file Content as a treeView in a SharePoint 2013 custom form edited with SharePoint Designer 2013

    Hello everyone,
    Within a list form, user has to select a value amongst a huge number of availables options.
    Instead of using something like a dropdown list, which would be very boring to parse, I would like to display possibles values in a treeview.
    To do that, I tried to use an <Sharepoint:SPTreeView bind to a SharePoint:SPXmlDataSource who read data from an XML File.
    <SharePoint:SPXmlDataSource runat="server" DataFile="../../SiteAssets/App_Data/myfile.xml" AutoSave="True" XPath="" ID="myDataXml"></SharePoint:SPXmlDataSource>
    <SharePoint:SPTreeView runat="server" ID="MyTreeView" DataSourceID="myDataXml" />
    But when I try to display the form in my web browser, an error occurs.
    Therefore, my question is : Is it possible to display the content of an Xml file as a treeView in a SharePoint 2013 custom form edited with SharePoint Designer 2013 ?
    If the answer is yes, how ? Which are the required properties for "SharePoint:SPXmlDataSource" tag and "SharePoint:SPTreeView"  tag ?
    What are the requirements to use thoses tags ?
    Regards,
    Florian.
    Ps : I dont have access to the server side of the SharePoint site I am working on.

    Assuming that https://fullsitename is a new URL address did you make sure to update your browser to include it in the Trusted Sites zone?  The message you are quoting is exactly the one you get if you don't have it in Trusted Sites.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • My orignal computer that I sync my iPhone 4 with does not work...can I sync it with a new computer?

    My original computer that I set up my iPhone 4 with
    Does not work.....can I use a new computer to sync
    The phone....how do I do this and is there a risk of
    Of losing any apps, music etc

    Try this:
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive

  • Pick activity is not working properly while creating two or more file adapt

    Hi,
    pick activity is not working properly while creating two or more file adapter for bpel process.
    bpel process compiled and deployed succesfully but while observing the wsdl file of deployed process you can find only one file adapter. so it polls only from that location.
    can anybody help on over this? or it's limitation of jdev to use only one file adapter at time while using Pick.
    Thanks
    sagar

    Does anybody tried this?
    Thanks
    sagar

  • Axis bank net secure with webpin not working on ipad2

    Hi,
    Axis bank net secure with webpin not working on ipad2
    Lt me know how to proceed

    Try using their App:
    https://itunes.apple.com/in/app/axis-bank-mobile-application/id517266358?mt=8

Maybe you are looking for

  • Display xMII Trends and graphs in SAP R/3

    Dear all, We have a requirement to see the trends of various production lines from xMII in SAP R/3 itself. Is it possible to have this graph in SAP ? Even if we are able to see the webpage then also it is ok. We are having RFC connection established

  • Why is the unlock-screen of my iPad mini showing black or blue lines?

    3 days ago, i bought an iPad mini at the apple store. Everything is working perfectly, but ever since I first started it, I'm noticing some black or blue lines at the bottom of the screeen on the unlock screen. They disappear after one second. I alre

  • TreeView Error in MVC pattern

    <htmlb:tree id        = "ztr_dpt"                   showTitle = "false"                   table2 = "//MODEL/ZA_IT_TREETAB">       </htmlb:tree> table2(MODEL/ZA_IT_TREETAB) structure: treeid   |  childid  |  text   |   statues |   click ztr_dpt |   00

  • Adding columns in query causes renames of fields

    Hi All, I'm using Oracle Reports Builder 10g. I have a query which has connections to other queries. When I try to add two columns into that query and recompile the RDF it automatically renames other fields adding "1" at the right side. Any ideas why

  • LSMW - Read Data not showing in Converted Data

    Hi, I am using LSMW to load data from a flat file (via recording).  I have it working except I have one issue.  When I display the data in read data all fields are showing.  No errors popup when I select convert data.  When I select display converted