Variable tooltip for JForm field

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Post Reply
MarkRS
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Thu Oct 29, 2009 8:28 am

Variable tooltip for JForm field

Post by MarkRS » Mon Apr 15, 2019 12:21 pm

I want to set an input field's tooltip from data.

I can do it easily enough when I code the html output myself in (eg) <view>/tmpl/default.php but I can't seem to do it with data loaded from an XML form.

I'd hoped

Code: Select all

		$this->form->setFieldAttribute($fieldname, 'description', $value);
would do it, but this sets the tooltip of the field label, not the field itself.

Is there a way to do this?

User avatar
paulala
Joomla! Explorer
Joomla! Explorer
Posts: 281
Joined: Sat Oct 30, 2010 12:32 pm
Location: Scotland
Contact:

Re: Variable tooltip for JForm field

Post by paulala » Wed May 01, 2019 9:43 am

You could use some page specific JS to set the tooltip of the parent at load or at any other time after if necessary.
Warm Regards,
Paula Livingstone, Skydiving Instructor and Network Security Consultant
https://paulalivingstone.com
http://rustyice.co.uk

MarkRS
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Thu Oct 29, 2009 8:28 am

Re: Variable tooltip for JForm field

Post by MarkRS » Wed May 01, 2019 8:46 pm

Thanks Paula. I might have to do that, I'd hoped not though

SharkyKZ
Joomla! Ace
Joomla! Ace
Posts: 1575
Joined: Fri Jul 05, 2013 10:35 am
Location: Unknown

Re: Variable tooltip for JForm field

Post by SharkyKZ » Thu May 02, 2019 7:39 am

"description" attribute is generally used for labels. Inputs normally do not have tooltips. What type of field are you using?

MarkRS
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Thu Oct 29, 2009 8:28 am

Re: Variable tooltip for JForm field

Post by MarkRS » Thu May 02, 2019 10:49 am

I'm not very good at "normal" :)

It's only a normal (ooops) text field. I was going to use the tooltip to show the translated text for the page's selected "alternate" language. However, somewhat to my surprise, the translation functionality looks very usable by extension writers so I think that's the way I'll go.


Post Reply

Return to “Joomla! 3.x Coding”