Forums

Problem with modal iframe JHTML::_('behavior.modal');

danielitob 11 Mar, 2014
Dear all,
i have a problem with modal iframe.
I created a form with a button, when you click on the button trigger a jquery method that calls a php file and returns the result in a div.
Example:
http://www.calabriaway.it/index.php?option=com_chronoforms&chronoform=consultaStrutture-Copy
click on the button "Ricerca" and then on the button "Dettagli", the popup doesn't work.

To make a test, i copied the content of php file( which before i called with method jquery) in a chronoform form, in this case the popup works correctly:
http://www.calabriaway.it/index.php?option=com_chronoforms&chronoform=consultaStrutture-Copy-Copy

I also put JHTML::_('behavior.modal'); in the index.php of template, but nothing.

Could you help me?
Let me know if you want other information.

Many thanks
Daniele
GreyHead 11 Mar, 2014
Hi Daniele,

It looks as though you have some problems with URLs:
Failed to load resource: the server responded with a status of 404 (Not Found) http://www.calabriaway.it/en/fetch_pagesModal.php
Failed to load resource: the server responded with a status of 404 (Not Found) http://www.calabriaway.it/en/getpagination.php

You also need to take great care when using jQuery on Joomla! 2.5 or earlier to make sure that it is in No Conflict mode.

Bob
danielitob 11 Mar, 2014
Dear Bob,
in the two link change "en" to "it" and the error disappears

Let me know.
Regards
danielitob 11 Mar, 2014
sorry , select italian language🙂 thanks
danielitob 11 Mar, 2014
Now, perhaps, i setted italian language as default language for all .
danielitob 12 Mar, 2014
Dear Bob,
have you any news?
If Italian language is not setted as default, please set it as language site. So, the ploblem, that you have mentioned, disappears.

many thanks
GreyHead 12 Mar, 2014
Hi Daniele,

You said you had settled it so I haven't looked again. What is the problem that you now have?

Bob
danielitob 12 Mar, 2014
thanks Bob.
Now i explane my problem with modal iframe.
I created a form that contains a button: when you click on the button, trigger a jquery method that calls a php file and returns the result in a div.
See my form below, click on the button "Ricerca" and then in the table on link "Dettagli", the popup doesn't work, but the site open a new page (not modal iframe)
http://www.calabriaway.it/index.php?option=com_chronoforms&chronoform=consultaStrutture-Copy

I did a test to see if the code works, i copied the content of php file( which before i called with method jquery) in a chronoform form: in this case the popup works correctly, if you click on link "Dettagli" the popup works correctly, as you can see below
http://www.calabriaway.it/index.php?option=com_chronoforms&chronoform=consultaStrutture-Copy-Copy


So , the problem occurs with an asynchronous call (jquery). "JHTML::_('behavior.modal') " seems not to work in this case.

I also put JHTML::_('behavior.modal'); in the index.php of template, but nothing.

Could you help me?
Let me know if you want other information.

Many thanks
Daniele
GreyHead 13 Mar, 2014
Hi Daniele,

If I click Ricerca nothing happens, I think that the validation is failing because there are four JavaScript errors that I can see on the page (using Chrome) even without the template.

I also don't see the ChronoForms script files, or the MooTools library being loaded.

Bob
danielitob 13 Mar, 2014
Dear Bob, your problem occurs because you use english language and not italian language.
Probably your browser language is English.
Now i 've disabled other language in my site so there is only italian language.
Please test now my problem and let me know if you have other problem.
Thanks for your patience
Regards
GreyHead 13 Mar, 2014
Hi Daniele,

That fixes the problems I was seeing but the MooTools library and the ChronoForms scripts still aren't being loaded. It looks as though maybe your template is blocking them?

Bob
danielitob 13 Mar, 2014
Click on the button "Ricerca "without filling in 4 fields because there isn't a validation
many thanks🙂
GreyHead 14 Mar, 2014
Hi Daniela,

It's a similar problem, the ChronoForms JavaScript files aren't being loaded.

Bob
GreyHead 18 Mar, 2014
Hi Daniele,

Yes that submits OK and returns an Italian page.

Bob
danielitob 18 Mar, 2014
Dear Bob,
ok thanks, but i don't understand if you have understood the problem🙂
Now i explane my problem with modal iframe in this page: http://www.calabriaway.it/index.php?option=com_chronoforms&chronoform=consultaStrutture-Copy

I created a form that contains a "Ricerca" button: when you click on the button, trigger a jquery method that calls a php file and returns the result in a div below.
See my form below, click on the button "Ricerca" and then in the table on link "Dettagli", the popup doesn't work, but the site open a new page (not modal iframe)

I did a test to see if the code works, i copied the content of php file( which before i called with method jquery) in a chronoform form: in this case the popup works correctly, if you click on link "Dettagli" the popup works correctly, as you can see below
http://www.calabriaway.it/index.php?option=com_chronoforms&chronoform=consultaStrutture-Copy-Copy

So , the problem occurs with an asynchronous call (jquery). "JHTML::_('behavior.modal') " seems not to work in this case.

I also put JHTML::_('behavior.modal'); in the index.php of template, but nothing.

Could you help me? What do you thing can i do?
Let me know if you want other information.

Many thanks
Daniele
GreyHead 19 Mar, 2014
Hi Daniela,

It took me along time to get the listing to display - I tried to select things in the drop-downs and got nothing.

As you say the modal.js file isn't loading on the listing page and is on the other form. Exactly how are you trying to load it? Where exactly are you putting the JHtml line?

Bob
danielitob 19 Mar, 2014
Dear Bob,
i put the code in chronoforms form.
Could i send you an email with the form build with chronoform and the php file ?
If yes, please provide me your email address.
Many thanks
regards
Daniele
danielitob 24 Mar, 2014
Dear Bob,
can i send you the php file?

Let me know , thanks very much
Regards
Daniele
GreyHead 26 Mar, 2014
HI Daniela,

You can add them here as a zip file or email to me at info##at##greyhead##dot##net

Bob
danielitob 26 Mar, 2014
Dear Bob,
Now i wrote you an email with subject: "topic : Problem with modal iframe JHTML::_('behavior.modal');"

Thanks very much for your time
Regards
Daniele
GreyHead 26 Mar, 2014
Hi Daniela,

Thanks for the code. I took a quick look but found it next to impossible to work out what it all was without sitting down and going through it line by line.

The Joomla! behaviour.modal code has changed a bit in recent versions and you should check the Joomla! documents to be sure that is correct. It should load from the template or anywhere else in the site provided that it is inside <?php . . . ?> tags. It will not load from an IFrame unless the IFrame is also loading the Joomla! application framework.

Bob
danielitob 27 Mar, 2014
Dear Bob,
thanks for your time.
Sorry but perhaps i don't understand, you say that in this way it doesn't work?
However i didn't use an iframe, but only an asynchronous call.
What do you mean for "it should load from the template" ?
Because i've already added the code in the index.php of template but nothing.

Regards
Daniele
GreyHead 28 Mar, 2014
Hi Daniele,

The only think I can suggest is that you go through step by step to debug the code you are using and check with the Joomla! documents that the syntax is correct.

You will need to make sure that the modal.js file is loaded before it is called. At present that doesn't seem to be happening.If you are using Async calls then It will presumably need to be loaded when the page loads using the JHTML method or loaded as part of the Async call.

I know that this probably isn't helpful but I don't have anything else to suggest to you.

Bob
danielitob 17 Apr, 2014
Dear Greyhead,
sorry for delay...i have added this code below everywhere
<script src="/media/system/js/modal.js" type="text/javascript"></script>
both in chronoform form and in php file (that is called with Async calls), but nothing.
Can i put it in other position?

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