- Posts: 214
COMMUNITY FORUM
Close modal and refresh parent page
- George Nasis
-
Topic Author
- Offline
- Elite Member
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]
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
- Posts: 214
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]
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
- Posts: 214
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]
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
- Posts: 214
Thank you again!
Please Log in or Create an account to join the conversation.
- jean-philippe
-
- Offline
- Premium Member
- [email protected]
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
- Posts: 214
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]
============================
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
-
Topic Author
- Offline
- Elite Member
- Posts: 214
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.
- jean-philippe
-
- Offline
- Premium Member
- [email protected]
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
-
Topic Author
- Offline
- Elite Member
- Posts: 214
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.
- jean-philippe
-
- Offline
- Premium Member
- [email protected]
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
-
Topic Author
- Offline
- Elite Member
- Posts: 214
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.
- jean-philippe
-
- Offline
- Premium Member
- [email protected]
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.