Modal Window not working

flyboeing 23 Dec, 2014
Hello all,

I am trying to get the Modal Window working. In my CC I have the following code:

<a class="modal" href='index.php?option=com_chronoforms&chronoform=airport_detail&tmpl=component&token={movements_ewas_airport.icao}'  rel='{handler: 'iframe',size: {x:500, y: 110}}' class="tooltip" title="{movements_ewas_airport.airport} ({movements_ewas_airport.icao} / {movements_ewas_airport.iata})">  {movements_ewas.dest}</a>


In the "Header" tab I have the JHTML::_('behavior.modal'); text.

When I go to my webpage showing the form and I click on the link, the "modal window" is opened in the same window (as a normal link) and not in a Modal Window.

Does someone has a solution for this problem?

Regards,
Ruud
carloso 24 Dec, 2014
make sure your template has this in the header :

JHtml::_('behavior.framework', true);
JHTML::_('behavior.modal');


and kudos to Max for this solutions :

you should change the curly bracket on this line because CC thinks that is a form value
{handler: 'iframe',size: {x:500, y: 110}}

change it using the html entities for the right and left curly bracket :

{ for the left/opening curly bracket

} for the right/closing curly bracket
carloso 24 Dec, 2014
oh ..sorry ... it's above the <head>

this is from my atomic template


<?php
/**
 * @package		Joomla.Site
 * @copyright	Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/* The following line loads the MooTools JavaScript Library */
JHtml::_('behavior.framework', true);
JHTML::_('behavior.modal');

/* The following line gets the application object for things like displaying the site name */
$app = JFactory::getApplication();
?>

<?php echo '<?'; ?>xml version="1.0" encoding="<?php echo $this->_charset ?>"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >
	<head>
GreyHead 24 Dec, 2014
Hi carloso,

I thing that it will work perfectly well if you add it to a Custom Code action in your form - unless you need it loaded on every page.
<?php
/* The following line loads the MooTools JavaScript Library */
JHtml::_('behavior.framework', true);
Jhtml::_('behavior.modal');
?>

Bob
flyboeing 30 Dec, 2014
Hmm i tried both things but it won't work.

I must admit, I updated my Joomla 2.5 website to Joomla 3.3. Since then it isn't working for me. Has it to do something with updating?
GreyHead 31 Dec, 2014
Hi flyboeing,

Probably yes, Joomla! switched from MooTools to jQuery between those two releases so I'd guess that the old MooTools modal window code no longer works. The 'best' solution is probably to switch to use whatever the current J3 modal window code is.

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