catalog item checkbox tooltip issues

timhorn
Kilo Expert

I have several checkboxes in one of my catalog items and I'm trying to add tooltips to them. This is on Geneva, by the way.   From what I've been able to find in the community, checkboxes don't normally support tooltips, even if you make sure it's available on the sc_req_item form.   I read some posts that talked about altering the title field of the element in an onLoad client script.   I tried it and got a very interesting result.   I added this:

gel('ni.IO:<checkbox-sysid>').title = 'My tooltip value';

When I bring up the form, I still have no tooltip value.   The interesting part is, if I inspect the element in the browser, it shows a blank title, but it has moved my tooltip value into an attribute called "data-original-title".   Does anyone have any idea how to prevent it from moving the "title" value to "data-original-title"?

1 ACCEPTED SOLUTION

Hi Cindy.   Thanks for the input.   I'm on Geneva as well.   Here is what it looked like when I first added the field messages:



field messages without labels.png


The messages for "Long-Lived Session" and "Original (Client) IP Required" are not directly under their checkboxes.   Then I added the labels as you recommended, and it looked like this:



field messages with labels.png


This is much better, but for it to work I had to put a label before each one, and that seemed a bit redundant. I decided to dive back into the rendered HTML, and I finally figured out that I was specifying the wrong element name when manually adding the title.   The following does work for checkboxes in an onLoad client script:



gel('ni.IO:<sysid>_label').title = 'some value';



Originally I was leaving off the "_label" portion of the element name, but when I added that it works perfectly.


View solution in original post

5 REPLIES 5

ckube
Tera Expert

I generally use field messages rather than tool tips - especially for checkboxes.


I gave this a try, and it puts it at the bottom of the whole "Options" section it creates for my group of checkboxes.   I suppose I could make that work if it didn't stick the "Options" title above each set of checkboxes.   Do you have any insights into how that might be accomplished?


ckube
Tera Expert

can you put up a screenshot?   and what version of ServiceNow you are on?   I am on Geneva and as long as I use a Label variable before my checkboxes it doesn't do that.


find_real_file.png


Hi Cindy.   Thanks for the input.   I'm on Geneva as well.   Here is what it looked like when I first added the field messages:



field messages without labels.png


The messages for "Long-Lived Session" and "Original (Client) IP Required" are not directly under their checkboxes.   Then I added the labels as you recommended, and it looked like this:



field messages with labels.png


This is much better, but for it to work I had to put a label before each one, and that seemed a bit redundant. I decided to dive back into the rendered HTML, and I finally figured out that I was specifying the wrong element name when manually adding the title.   The following does work for checkboxes in an onLoad client script:



gel('ni.IO:<sysid>_label').title = 'some value';



Originally I was leaving off the "_label" portion of the element name, but when I added that it works perfectly.