C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Auto Populate Current User Login Name in SharePoint
WhatsApp
Laxman Vyavahare
10y
28.3
k
0
0
25
Blog
<script src=
"https://code.jquery.com/jquery-1.10.2.min.js"
type=
"text/javascript"
></script>
<script src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.02/jquery.SPServices-2014.02.min.js"
type=
"text/javascript"
></script>
<script type=
"text/javascript"
>
$(document).ready(
function
() {
// get the title of current user
var
UserName= $().SPServices.SPGetCurrentUser({
fieldName:
"Title"
,
debug:
false
});
//populate the field ‘Requestor’ with the current account
$(
'textarea[title="Requestor"]'
).val(UserName);
$(
'input[title="Requestor"]'
).val(UserName);
});
</script>
In following Image you can see current user name will be auto populated on page load.
Auto populate current user
Recommended related topics
Membership not found