Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Unable to get some user values on a SP2010 new item form

$
0
0

Hi, I have a new item form which I want to inject some information into:

Office

Department

User's Full Name

Here's the code i'm using....the only field which is working is Office

 

 

$(document).ready(function() {

	var userOffice = $().SPServices.SPGetCurrentUser({
		fieldName: "Office"
	});
	$("input[Title='Office']").val(userOffice);

	var userBU = $().SPServices.SPGetCurrentUser({
		fieldName: "Department"
	});
	$("input[Title='Business_x0020_Unit']").val(userDepartment);

	var userName = $().SPServices.SPGetCurrentUser({
		fieldName: "Title"
	});
	$("input[Title='Title']").val(userName);

	});


Can anyone see anything obvious? Btw, I've done the 'alert' tests and know that the SPServices scripts are working. If I'm not supplying enough info let me know what you need.

Thanks! Paul


Viewing all articles
Browse latest Browse all 6517

Trending Articles



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