locked
Dropdown Fields Tooltip.. RRS feed

  • Question

  • Hi, all.

    can't use Web Part. Only in sharepoint online and sharepoint designer.

    1. I have a Request Name field in my list, in new list form how to have it auto populated with current user's name?

    2. I have Dropdown menu field, in dropdown menu field i want to set tooltip every data in dropdown..

    Anyone can help me?

    #I'm Beginner :)

    #Thanks

    Wednesday, January 24, 2018 8:20 AM

All replies

  • Hi Nhdy- you can retrieve the current user using the user profile service in SharePoint designer. As far as the tool tip, you'd have to use a form designing program like InfoPath or Nintex so you can add javascript code.

    cameron rautmann

    • Proposed as answer by Nguyen Kevin Wednesday, January 24, 2018 1:07 PM
    Wednesday, January 24, 2018 1:04 PM
  • can i get current user in javascript and display name as read only.

    Wednesday, January 24, 2018 2:10 PM
  • I can't think of a way to do that with JS.

    cameron rautmann

    Wednesday, January 24, 2018 2:14 PM
  • Oh, really?

    Did you have any suggestion for this?

    can't use Web Part. Only in sharepoint online and sharepoint designer.

    I'm Beginner.

    Thanks :)

    Wednesday, January 24, 2018 2:34 PM
  • Hi Nhdy,

    For SharePoint Online, we can use _spPageContextInfo to get the current user name. It provides the userId and userLoginName properties.

    For example:

    <script type="text/javascript">
    
    var loginName = _spPageContextInfo.userLoginName;
    
    alert(loginName);
    
    </script>


    SharePoint: Understanding the _spPageContextInfo object:

    https://social.technet.microsoft.com/wiki/contents/articles/29766.sharepoint-understanding-the-sppagecontextinfo-object.aspx

    Using JavaScript to set the field value in the form. Then, set the field to ready only.

    A demo: set a field value via JavaScript

    <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
    
    <script type="text/javascript">
    
    $(document).ready(function(){
    
    $("input[Title='<column>']").val(loginName);
    
    });
    
    </script>


    Another method, we can use GetUserCollectionFromGroup method in InfoPath to get current user information. And then, set this field property to Read Only.

    Here are the steps for your reference:

    1. Open InfoPath and click the DATA tab, then click From SOAP Web Service under From Web Service.

    2. Enter the location of the SOAP Web service definition: http://<site>/_vti_bin/userprofileservice.asmx, then click Next.

    3. Select GetUserProfileByName and click Next.

    4. Make sure ‘Automatically retrieve data when form is opened’ is checked.

    5. Add a textbox. In the “Default Value” section, click the “fx” button.

    6. Click “Insert Field or Group…”. IN the data sources drop down, select the GetUserProfileByName.

    7. Choose the “Value” field and click the “Filter data…” button.

    8. Click “Add…”, select “Select a field or group…” and select “Name”.

    9. Leave the middle drop down as is (‘is equal to’) and in the last drop down choose ‘type a text…’. Type “FirestName” or ” LastName” which you want to show in the field.


    For more information, please read the blog below.

    https://samsharepoint.wordpress.com/2013/04/30/infopath-get-the-current-user-without-writing-code/

    To show the tool-tip for each value in drop down, you may need to code with Callout feature.

    http://srinivasnarula.blogspot.sg/2015/03/callouts-in-sharepoint-2013-online.html

    Best regards,

    Linda Zhang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    • Proposed as answer by Dean_Wang Monday, January 29, 2018 9:44 AM
    Thursday, January 25, 2018 10:04 AM
  • Hi Linda Zhang,

    I'm actually can't using infopath.. Any suggestion for tooltip?

    Friday, January 26, 2018 12:51 AM
  • Hi Nhdy,

    For the auto-populate requirement, you can try the first method.

    For the tooltip, you need code with Callout feature.

    Check the suggestion in the reply above.

    Best Regards,

    Linda Zhang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Monday, January 29, 2018 9:42 AM