locked
Sharepoint Dropdown Fields Tooltip.. RRS feed

  • Question

  • Hi all,

    Did you know how to create dropdown with tooltip in sharepoint?

    Could you please suggest me best way to accomplish this functionality.

    Thanks.

    Monday, February 26, 2018 3:00 AM

Answers

  • Hi Nhdy, 

    From the code you offered, this is the server side control, you need to add the following code in the aspx page instead of html page.

    Open your page with SharePoint Designer, add the following code in the aspx page:

    <asp:DropDownList ID = "ctl00_ctl45_g_4d32d63d_0d5c_4ddd_850b_bb333081a373_ff91_ctl00_Lookup" runat="server">
            <asp:ListItem Text="Please Select" Value="0" />
            <asp:ListItem Text="Desktop  -  5050" Value="1" />
            <asp:ListItem Text="Laptop - E7480" Value="3" Title="Recommended: Employees that frequently travel, require mobility" />
            <asp:ListItem Text="Laptop -  E5580" Value="6" Title="Recommended: Employees that require mobility" />
            <asp:ListItem Text="Laptop -  5285" Value="7" Title="Recommended: Senior Management " />
        </asp:DropDownList>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
        <script type="text/javascript">
            $(function () {
                $("[id*=ctl00_ctl45_g_4d32d63d_0d5c_4ddd_850b_bb333081a373_ff91_ctl00_Lookup] option").each(function (i) {
                    if (i > 0) {
                        var title = "PC Model: " + $(this).val();
                        $(this).attr("title", title);
                    }
                });
            });
        </script>

    Then it displays like the following:

    Best Regards, 

    Lisa Chen 


    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, February 26, 2018 8:29 AM