Placeholder option for tooltips

Home Forums Classic DFFS Placeholder option for tooltips

Tagged: 

Viewing 3 reply threads
  • Author
    Posts
    • #21899
      DCH
      Participant

        Alexander,

        Can you add a option on the Field Tooltip tab to display the text as an icon or as a input placeholder text? I have a ton of jQuery in my Custom JS tab to handle it and thought it would make a nice feature. E.g.,

        jQuery("input[id^='somefieldname']").attr("placeholder","sometooltiptext").val("").focus().blur()

        Thanks!

      • #21902
        Alexander Bautz
        Keymaster

          I don’t understand exactly what you mean – can you share a screenshot of how this would look in the form?

          Alexander

        • #21912
          DCH
          Participant

            Sure, here is the spec:

            https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Labels_and_placeholders

            And an example image attached. Check out the “Type of OS” field. It shows a hover icon from dffs, and the html5 placeholder I’m injecting with jQuery. When the user clicks into the field the placeholder text disappears and is replaced with their text.

            I would like to be able to choose whether the help text is in an icon, or a placeholder for each field. Only input and textarea fields support the placeholder attribute.

            • This reply was modified 6 years, 4 months ago by DCH.
            Attachments:
          • #21921
            Alexander Bautz
            Keymaster

              I see what you mean now, but I don’t think I can add this to the tooltip functionality – mainly because the placeholder (like you pointed out) is only available for input and textarea elements.

              You can use this function to add this placeholder:

              function addPlaceholderText(fin,text){
              	jQuery("#dffs_"+fin).find("input, textarea").attr("placeholder",text);
              }
              // Call it like this
              addPlaceholderText("YourFieldInternalName","Placeholder text here");

              Alexande

          Viewing 3 reply threads
          • You must be logged in to reply to this topic.