cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Cris2
Helper II
Helper II

Change checkbox tooltip to show the value

Hi 

 

In the below lookup modal, I would to replace the tooltip for checkboxes to show their corresponding country name instead of 'Checkbox'. How can I do this using javascript.

 

Cris2_0-1636589599456.png

 

Thanks

Cris

 

7 REPLIES 7
ragavanrajan
Super User
Super User

Hey @Cris2 

 

please confirm what is the checkbox data type? 

Hi

 

It's an entity lookup.

Hi @Cris2 

Please use below JS code:

   $("#fieldlogicalname_lookupmodal .entity-lookup .modal-content .fa.fa-fw.fa-check").attr("data-original-title","Your tooltip");
    $("#fieldlogicalname_lookupmodal .entity-lookup .modal-content .fa.fa-fw.fa-check").attr("title","Your tooltip");
     $("#fieldlogicalname_lookupmodal .entity-lookup .modal-content .fa.fa-fw.fa-check").attr("aria-label","Your tooltip");

 

Please replace "fieldlogicalname" with your field logical name of lookup field.

 

--------------------------
If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!

Hi @hardikv 

 

I request was to show the Country name as a tooltip for each of the checkbox.

 

Thanks

Hi @Cris2 

 

Please add below code:

$(document).ready(function() {
    var list = $("#new_lookuplogicalname_lookupmodal").find(".entity-lookup").find(".entity-grid").eq(0);
    list.on("loaded", function () {
        list.find("table tbody tr").each(function () {
            var countryName = $(this).find("td[data-attribute='new_country']").attr("data-value");
            $(this).find("td").eq(0).find(".fa.fa-fw.fa-check").attr("data-original-title",countryName);
            $(this).find("td").eq(0).find(".fa.fa-fw.fa-check").attr("title",countryName);
            $(this).find("td").eq(0).find(".fa.fa-fw.fa-check").attr("aria-label",countryName);
        });
    });
});

 

Please replace new_lookuplogicalname with your lookup field logical name & new_country with your Country field logical name.

 

--------------------------
If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!

hardikv
Solution Sage
Solution Sage

Hi @Cris2 

 

Did that help to solve your issue?

Thanks @hardikv 

 

The country name is appearing as tooltip for only the first checkbox in the list. The tooltip for the subsequent checkbox still says 'checkbox'. Your help would be much appreciated.

 

Thanks

C

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (3,108)