Using following script in your page by SharePoint Designer or Content Editor WP
<script language="javascript" src="/TimeSheet/jQuery%20Libraries/jquery-1.4.2.min.js" type="text/javascript"></script>
<script language="javascript" src="/TimeSheet/jQuery%20Libraries/jquery.SPServices-0.5.4.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
var userDepartment = $().SPServices.SPGetCurrentUser({
fieldName: "Department"
});
$("input[Title='Department']").val(userDepartment);
});
</script>
In this script, we auto fill Department textbox by department of current user.
Không có nhận xét nào:
Đăng nhận xét