› Forums › Classic DFFS › Dynamic Tool Tip
Tagged: ToolTip
- This topic has 4 replies, 2 voices, and was last updated 5 years, 1 month ago by
Kelly Turdanes.
-
AuthorPosts
-
-
May 1, 2018 at 07:07 #20758
Kelly Turdanes
ParticipantHi Alexander,
Is it possible to make the field tooltip dynamic?
Thanks.
Kelly
-
May 1, 2018 at 08:38 #20765
Alexander Bautz
KeymasterYes, you can add this to the tooltip placeholder:
{var:myCustomTooltipVariable}
Please note that you must use a single whitespace before the first { to bypass the JSON string parser – if not it will be throwing an error – I’ll get this fixed in the next release.
Then you can update the variable myCustomTooltipVariable in your Custom JS.
You can also use field values from the current form by using the fieldinternalname in curly braces like this:
This is the value in the Title field: {Title}
Alexander
-
May 2, 2018 at 04:31 #20781
Kelly Turdanes
ParticipantCool how about updating the tooltip’s content based on the selected value of the field?
Thanks.
Kelly
-
May 2, 2018 at 20:28 #20797
Alexander Bautz
KeymasterIf you mean to change the text based on for example a status, you must create a variable like this in your Custom JS:
var myCustomTooltipVariable = "Original text";
Then create a rule to trigger on change of the field you want to use to change the tooltip text, and set it to call the custom function in your Custom JS. Set up the function like this:
function changeMyTooltip(){ var status = getFieldValue("Status"); switch(status){ case "Not started": myCustomTooltipVariable = "A tooltip text suited for this status"; break; case "In progress": myCustomTooltipVariable = "A tooltip text suited for this status"; break; } }
This will update the tooltip text based on the columne named “Status”. Use the variable in the tooltip textarea like described in the comment above (keep in mind the single whitespace before the first curly brace).
Use this as a starting point and let me know if you have any questions.
Alexander
-
May 3, 2018 at 00:03 #20808
Kelly Turdanes
ParticipantThanks so much. I’ll give it a try.
-
-
AuthorPosts
- You must be logged in to reply to this topic.