- Posts: 214
COMMUNITY FORUM
Close modal and refresh parent page
- George Nasis
- Topic Author
- Offline
- Elite Member
Less
More
11 years 4 months ago - 11 years 4 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. :(
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.
- jean-philippe
- Offline
- Premium Member
- [email protected]
11 years 4 months ago #113774
by jean-philippe
Emond, 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
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
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 214
11 years 4 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
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.
- jean-philippe
- Offline
- Premium Member
- [email protected]
11 years 4 months ago #113776
by jean-philippe
Emond, 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?
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
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 214
11 years 4 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!
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.
- jean-philippe
- Offline
- Premium Member
- [email protected]
11 years 4 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 ":
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
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 214
11 years 4 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!
Thank you again!
Please Log in or Create an account to join the conversation.
- jean-philippe
- Offline
- Premium Member
- [email protected]
11 years 4 months ago #113780
by jean-philippe
Emond, 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 :
when I'm log-in :
hum... :-/ didn't see it...
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
Please Log in or Create an account to join the conversation.
- George Nasis
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 214
11 years 4 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 try to login with username:demo pass:demo
Thannnnxxxxx!!! :)
Please Log in or Create an account to join the conversation.
- jean-philippe
- Offline
- Premium Member
- [email protected]
11 years 4 months ago - 11 years 4 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...)
============================
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.