Forums

I need the "tooltip" to display in a a lightbox...

arrick 24 Apr, 2015
I have been able to change the tooltip, but am not familiar enough with programming yet to be able to get a tooltip to display in a lightbox, instead of in the box that has an arrow pointed at the "I' image.. I would like to have a lightbox that will display the necessary information in the middle of the screen, instead of the image below... If the screen is not maxed out, it causes issues with the layout, tips getting cut off, etc.

http://mwforms.miworksmo.org/dvop-app

GreyHead 09 May, 2015
Answer
Hi moorear,

This is not an ideal solution - but I got it to work using the free version of the NoNumber modal plug-in for Joomla!.

In the Label box I added this code
Text Label {modal http://j34.greyhead.org/index.php?option=com_chronoforms5&chronoform=test_modal_tooltip&event=tt&tmpl=component|width=400px; }<i class='fa fa-exclamation-circle' style='color:#2693FF; padding-left:5px;' ></i>{/modal}


Broken down there are three parts:

+ The normal text label

+ The {modal} link which here loads some content from a new form event (see below)

+ An <i> tag which shows the tooltip icon.

To display the text I added a new Form event called tt in the Setup tab and put the tooltip text in a Custom Code action there. In practice if you have multiple tooltips you could add an extra parameter to the URL e.g. &q=1 and use a PHP Switch statement to display different tooltip content depending on the value of the parameter.
<?php
switch ( $form->data['q'] ) {
  case 1 :
    echo 'Ut leo. Nunc nec neque. Etiam imperdiet imperdiet orci. Curabitur turpis. Cras ultricies mi eu turpis hendrerit fringilla.';
    break;
  case 2 :
    echo 'Fusce risus nisl, viverra et, tempor et, pretium in, sapien. Donec interdum, metus et hendrerit aliquet, dolor diam sagittis ligula, eget egestas libero turpis vel mi..';
    break;
  . . .
}
?>

Bob
This topic is locked and no more replies can be posted.