Validation tool tip. Want to remove the title (says Validation)

doni49

New Member
Whenever I enable validation on any field, a tooltip appears on mouseover. I'm generally fine with that but I don't see the need for the Validation title. Can I remove that somehow?
 
...... Or at least change what it says per element.
I don't know how to get rid of the title container entirely - but you can either set it to a blank space
JavaScript:
jQuery('label[for=tablename___element_name]').attr('data-original-title',' ');
or change it
JavaScript:
jQuery('label[for=tablename___element_name]').attr('data-original-title','New Validation Title');
by using similar jQuery code in the form_#.js file.
 
Is there any way to make it use the field's label as the validation title? i.e. I'd like to change it once and have ALL the validations (or maybe all of the same type) use the label's value of the respective field.
 
Try this (I didn't test)....
Code:
var label = jQuery('label[for=tablename___element_name]').text();
label = jQuery.trim(label);
jQuery('label[for=tablename___element_name]').attr('data-original-title',label);
If that works, I suppose it would be just as simple to them all in a loop...
JavaScript:
jQuery(label.fabrikTip).each( function() {
    var label = jQuery(this).text();
    label = jQuery.trim(label);
    jQuery(this).attr('data-original-title',label);    
});
Though, since validations and tips share the same widget, I'm pretty sure either solution would 'step on the toes' of any titles you might have set in the 'Tip' tab in the Publishing section of the element's configuration.
 
Last edited:
@Bauer - it would be easy enough to add YAFO to either the form or element, and test for it where that title is added (currently line 1765) in tipOpts() in the main element model:

Code:
        if ($this->editable)
        {
            if ($this->validator->hasValidations())
            {
                $opts->heading = FText::_('COM_FABRIK_VALIDATION');
            }
        }

Probably a three option setting on the form, for "Validation Tip Titles", "None / 'Validation' / Element label", or whatever.

-- hugh
 
@Bauer - it would be easy enough to add YAFO to either the form or element, and test for it where that title is added (currently line 1765) in tipOpts() in the main element model:

Code:
        if ($this->editable)
        {
            if ($this->validator->hasValidations())
            {
                $opts->heading = FText::_('COM_FABRIK_VALIDATION');
            }
        }

Probably a three option setting on the form, for "Validation Tip Titles", "None / 'Validation' / Element label", or whatever.

-- hugh

That sounds EXACTLY like what I'm looking for.

What is YAFO?

And is the code you posted something that I need to add to the referenced file?
 
YAFO is Yet Another Freakin' Option.

No, that's just where someone would need to splice in the check for any new option, which would have to be added to the form params.
 
If that's meant to be a hint - I've been quite busy with 'domestic' work - as well as learning about and experimenting rooting my old smart phone. So yeah, whenever.:rolleyes:
 
Back
Top