I have a custom mobile page that I setup for a time entry system we have in SharePoint 2010. The entry is for techs to enter their time.
The people picker will not default to the current user only when displayed in the MOBILE browser. I have tried it in Chrome and Safari. It works fine if I pull up the same mobile view URL in chrome or IE on my PC.
Please note: I am NOT using ootb Mobile Views/forms. This is basically a blank page with a new form on it that I am calling from a url. Very simple.
Here is the code I am using:
<script language="javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js" type="text/javascript"></script><script language="javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.2/jquery.SPServices-0.7.2.min.js" type="text/javascript"></script><script language="javascript" type="text/javascript">
var $jQ = jQuery.noConflict();
$jQ(document).ready(function() {
var userName = $jQ().SPServices.SPGetCurrentUser({
fieldName: "Name"
});
$jQ("textarea[title='People Picker']").val(userName);
$jQ("div[title='People Picker']").text(userName);
});</script>
The people picker will not default to the current user only when displayed in the MOBILE browser. I have tried it in Chrome and Safari. It works fine if I pull up the same mobile view URL in chrome or IE on my PC.
Please note: I am NOT using ootb Mobile Views/forms. This is basically a blank page with a new form on it that I am calling from a url. Very simple.
Here is the code I am using:
<script language="javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js" type="text/javascript"></script><script language="javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.2/jquery.SPServices-0.7.2.min.js" type="text/javascript"></script><script language="javascript" type="text/javascript">
var $jQ = jQuery.noConflict();
$jQ(document).ready(function() {
var userName = $jQ().SPServices.SPGetCurrentUser({
fieldName: "Name"
});
$jQ("textarea[title='People Picker']").val(userName);
$jQ("div[title='People Picker']").text(userName);
});</script>