2

Is there a way, to add tool tips or a simple text next to a field widget in QGIS forms drag and drop designer?

I would like to provide more information about some fields (restrictions, expected value etc.) to the user to help him, filling in the form.

1 Answer 1

2
+50

You can do that with HTML code.
Select the HTML Widget Option.

enter image description here

You can then configure each text node as a link using <a> and assign it a title.

enter image description here

The code i used (taken as an example from here):

<a href=" " title="This is some text I want to display." style="background-color:#FFFFFF;color:#000000;text-decoration:none"> ID  </a>: 

The <script> part was generated from me adding the field i wanted, and it's simply wrapped in a link tag. Since these will be the field labels, you should turn the labels off.

enter image description here

This is the end result.

enter image description here

You can continue to style the labels with css so they would look better, but this is the basic version of what you asked.

5
  • Thanks for the answer. I don't have HTML widget visible in the Available Widgets list? Is there somewhere to turn it on? I am working on a Postgis layer, I don't know if this makes a difference? Commented Nov 2, 2020 at 11:18
  • This is probably a version issue, which QGIS version are you using? I get it as available in 3.10 with a PostGIS layer
    – Dror Bogin
    Commented Nov 2, 2020 at 11:32
  • @MartinHügi did you try upgrading QGIS?
    – Dror Bogin
    Commented Nov 4, 2020 at 13:13
  • Hi, yes, I have tried it in 3.8 now and HTML widget is there. I don't completely follow the instructions, but I have given it a go and I do get something like as shown in your end result. I just need to spend some time working out how to get it to layout as I want.. Thanks for your answer. Enjoy your bounty! Commented Nov 5, 2020 at 9:26
  • Is there a way to reduce the height of the HTML widget?
    – Damien
    Commented Dec 21, 2021 at 0:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.