Keyword

Close modal and refresh parent page

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 11 months ago - 11 years 11 months ago #113773 by George Nasis
Close modal and refresh parent page was created by George Nasis
Hi..
i experience a problem and i am working with it few hours but i can`t find a solution. I am trying to load on a modal window the comment page. It`s working but when i submit the comment there is no redirect to the parent page.

in the controller of the comment i have put a new function

function testfunction() {
$document = JFactory::getDocument();
$js = "javascript: window.parent.document.location.reload(true);";
$js .= "javascript:window.parent.SqueezeBox.close();";
$document->addScriptDeclaration($js);
}

but i get on a blank page the message: {"message":"Comment added! Refreshing page...","refresh":1}

I know that something is going wrong with the js but i dont know what. i tried to change the parameteres ok k2 about javascript but with no result. :(

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #113774 by jean-philippe
Replied by jean-philippe on topic Re: Close modal and refresh parent page
HI George Nasis,

I suppose that you use an Iframe modal window for open your form..... and your submit button is not bind to the javascript.. so the button submit form before JS get the form..

one solution is using Ajax submit and reload page using your javascript...
and load your modal in "inline" mode...


Best Regards,
Emond, Jean-Philippe

Emond, Jean-Philippe

Please Log in or Create an account to join the conversation.

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 11 months ago #113775 by George Nasis
Replied by George Nasis on topic Re: Close modal and refresh parent page
Hi Jean-Phillipe!

thanx for your answer!i think i understand what you mean!but i don`t know what exactly code to write for the submit button which indeed is on the form which is loaded in the modal window..could you help me about this?

Best regards

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #113776 by jean-philippe
Replied by jean-philippe on topic Re: Close modal and refresh parent page
Hi Goerge,

Do you have a link where you have this bug?

Emond, Jean-Philippe

Please Log in or Create an account to join the conversation.

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 11 months ago #113777 by George Nasis
Replied by George Nasis on topic Re: Close modal and refresh parent page
www.proteino.gr/index.php/politismos/biblio/mythistorima/item/42-leonidas4#.UafFe0BM8rX

at the bottom of the page under the comments there is "LINK" which opens the modal!

Thank you very much Jean!

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #113778 by jean-philippe
Replied by jean-philippe on topic Re: Close modal and refresh parent page
Ok George I got it..

on your "comment link"... you don't have the class="modal"

So I have submit a report..

to close the modal into your "modal" page...

just put in your ":
					
Emond, Jean-Philippe

Please Log in or Create an account to join the conversation.

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 11 months ago #113779 by George Nasis
Replied by George Nasis on topic Re: Close modal and refresh parent page
Oh i am very sorry Jean and thank you very much for your time but i see there is a misunderstood. When i said under the comments i meant under all over the comments.. :/ sorry that i bother you. the link i mean is "LINK" and it is exact above the "More in this category:" at the bottom of the page and under the pagination "start 1 2 end". Sorry again!if you have time please check it

Thank you again!

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #113780 by jean-philippe
Replied by jean-philippe on topic Re: Close modal and refresh parent page
Hi George Nasis,

it's ok... I am here to help :-)

when i'm not log-in :

Attachment not found



when I'm log-in :

Attachment not found



hum... :-/ didn't see it...

Emond, Jean-Philippe
Attachments:

Please Log in or Create an account to join the conversation.

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 11 months ago #113781 by George Nasis
Replied by George Nasis on topic Re: Close modal and refresh parent page
hhhmmm.. :/ probably this is something else i have to fix..but some other day.. :)
please try to login with username:demo pass:demo

Thannnnxxxxx!!! :)

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago - 11 years 11 months ago #113782 by jean-philippe
Replied by jean-philippe on topic Re: Close modal and refresh parent page
Ok I know what is the problem..you don't have any JS to stop and submit your form...
============================
EDIT : put an ID to your <form>

here it's : "linkCommentModalForm"
=========
so you need to create something like the last post. so something like that:
(in K2.js or something...)
					
Emond, Jean-Philippe

Please Log in or Create an account to join the conversation.

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 11 months ago - 11 years 11 months ago #113783 by George Nasis
Replied by George Nasis on topic Re: Close modal and refresh parent page

Attachment not found


item_comments_form.php

k2.js
Hi fantastic Jean!I am sure that you are very close to solve this out!Because i am working on it the laste 6 hours.. :) Unfortunately in k2.js there is this code :( i will attach the code of the item_comments_form!This might help!

Thanks a lot!

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #113784 by jean-philippe
Replied by jean-philippe on topic Re: Close modal and refresh parent page
George...

this is not your modal form... this is another "form"....

your modal form is located here:
www.proteino.gr/?ml=1#test

Emond, Jean-Philippe

Please Log in or Create an account to join the conversation.

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 11 months ago #113785 by George Nasis
Replied by George Nasis on topic Re: Close modal and refresh parent page
Good morning Jean!

In the image i send you the <div> #test begins in the six line!I have changed the core of the item_comments_form of k2!But i don`t think it`s affect my problem.I had suspected the jQuery library of k2 in parameteres but i have changed tha paremeterers.I cannot think something else.. :/


Regards George

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #113786 by jean-philippe
Replied by jean-philippe on topic Re: Close modal and refresh parent page
Good Morning George...

Look...

your form that you call in your link...

IS NOT your form with the ID "test"...
make a test...

modify your "form" action for that:
					
Emond, Jean-Philippe

Please Log in or Create an account to join the conversation.

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 11 months ago #113787 by George Nasis
Replied by George Nasis on topic Re: Close modal and refresh parent page
Hallo Jean!

No it doesn`t work.. :( i am disappointed with my knowledge of php..Have you another idea except to study php?? :)

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #113788 by jean-philippe
Replied by jean-philippe on topic Re: Close modal and refresh parent page
HI George,

see the last post of this thread . from oscar.

It's maybe the solution that your need...


Best regards,
Emond, Jean-Philippe

Emond, Jean-Philippe

Please Log in or Create an account to join the conversation.