Quantcast
Viewing all articles
Browse latest Browse all 6517

New Post: $().SPServices.SPGetCurrentUser not working on the Title field?

Hi Marc,

I put 2 alerts on my code. The first alert displays BLANK value but the second one does displays the email address of the current user. Also, using jquery-2.0.3.js and jquery.SPServices-2013.01.js I don't get any value and alerts at all using the same code below just replacing the reference of the scripts. Have tried re-uploading the scripts using SharePoint Designer but with the same result. We are really stuck now. Please advise.
<script src="/Scripts/jquery-1.6.2.js" type="text/javascript"></script>
<script src="/Scripts/jquery.SPServices-0.7.2.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">

$(document).ready(function() {
    var userName = $().SPServices.SPGetCurrentUser({
        fieldName: "Title"
    }); alert(userName);
    $("input[Title='Initiator']").val(userName); 
});</script><script language="javascript" type="text/javascript">

$(document).ready(function() {
    var userEmail = $().SPServices.SPGetCurrentUser({
        fieldName: "EMail"
    });alert(userEmail);
    $("input[Title='InitiatorEmail']").val(userEmail); 
});</script>
Thanks,

Arnel

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>