norcross / gravity-tooltips

Adds a custom field to each form element for tooltips
MIT License
74 stars 20 forks source link

Manual tooltip tag for checkbox/radio fields #9

Closed psaikali closed 9 years ago

psaikali commented 9 years ago

Hi there,

Currently, tooltip only belongs to a field, and that works fine. But if a field have multiple "answers" (like checkboxes or radios fields type), there is only one "official" tooltip for the field.

But it happens that sometimes, I need a tooltip for each checkbox/radio entry. I hard-coded the img tooltip in the "label", like so :

capture d ecran 2014-10-12 16 11 19

Label text <img src="tooltip.png" class="gf-tooltip-icon-img" data-tooltip="Tooltip content" />

(note that the field needs the "gf-tooltip gf-tooltip-icon" CSS classes in the "advanced" GF field tab to work properly)

This works ALMOST fine. Tooltips do appear on hover, but the content loaded is alway the same (the FIRST label tooltip). The other ones are ignored.

Do you have any idea on how to make this work ?

Thanks for your work anyway, great little addition to Gravity Forms.

norcross commented 9 years ago

I'll need to think about this. since the tooltip is pulled from a single field, there isn't a clear cut way to allow for multiple blocks of text that I'm aware of.

psaikali commented 9 years ago

Ho, thanks for the quick answer. OK, I'll try to find a workaround tomorrow then... Thx !

norcross commented 9 years ago

since there isn't a way to add multiple fields on a single field for radio items, this isn't doable.