Discussion
Close Comment Popup On Submit(back to index)Hey everyone -
Any ideas how I can close the comment popup window after the user clicks on the "Submit Comment" button?
I am not showing the comments in the popup, just having it for submitting new ones, and if the popup window stays open after they submit the comment... well, it gets confusing.
Hope someone can help me out!
Thanks
posted by
Abraham on 6 Aug 05 at 12:44 PM
You'd do this with javascript — after the comment is submitted, run a window.close event.
posted by
donald on 19 Aug 05 at 1:44 AM
But how do I give it enough time to submit and write the data to the file so the comment is saved?
posted by
Abraham on 19 Aug 05 at 10:30 AM
What you would have to do is post the comment as normal, which will shoot you back to /comments/, which takes care of your posting. On your template_comments.php file, you would have to include a conditional statement that includes the Javascript close event on load if a comment has been posted.
This is entirely pseudo-code (I don't know the javascript offhand), but something to this effect:
if (get("doComment")) {
echo ("<body onload='window.close()'>");
}
else {
echo ("<body>");
}
posted by
donald on 20 Aug 05 at 2:38 PM
dfhasdfjh
posted by
Name on 14 Dec 05 at 8:20 PM
Post a Reply:
(back to index)