I have a Joomla module with a JForm having a few fields. I implemented client side validation for the field as described here: https://docs.joomla.org/Client-side_form_validation
I can also show a tooltip message for the fields when cursor is hovering above based on the below: https://docs.joomla.org/J3.x:How_to_add_tooltips_to_your_Joomla!_website
But I could not figure out yet how to show those tooltips ONLY when the user entered invalid data into the field.
What would be the best way to do this?
Thanks a lot!
I think the best way would be to use a custom class for the tooltip, and only do the javascript init on the form validation. e.g:
and
However imo, it's probably not a good idea, it's better to show the error directly before of after the field, without needing the user to hover on the field.