Author Topic: Need help with new feature [move comment form into a popup window]  (Read 5274 times)

0 Members and 1 Guest are viewing this topic.

Offline terryjianlin

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
    • http://www.2ufj.com
Need help with new feature [move comment form into a popup window]
« on: September 02, 2006, 03:07:19 AM »
I was tring to do this:
 move the comment form  into a popup window when user click post a comment button, which will make details pages shorter for a better looking. but somehow I run into some problem which stop me from going any further.
Here is what I do:
#1st step: I deleted {comment_form} in details.html, and insert this instead
Quote
<input TYPE="button" VALUE="POST A COMMENT" ONCLICK="NewWindow()">
<script language="JavaScript">
<!--
function NewWindow(){window.open("index.php?template=comment_form","","height=400,width=300,left=10,top=10,status=no,location=no,toolbar=no, directories=no,menubar=no");}
// -->
</script>

#2nd step: in the comment_form.html, I di the follow change :
insert
Quote
<script language="javascript" type="text/javascript">
<!--

  var captcha_reload_count = 0;
   var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
        document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
      } else {
        document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
      }

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }
--></script>
<link rel="stylesheet" href="{template_url}/style.css" />

into top of the page, then I delete all the {} tags, because they doesn't show any thing in the popup window, and replace words with them  manualy, and in the
Quote
<form name="commentform" action="{self}" method="post" onsubmit="postbutton.disabled=true;">
and I changed into this
Quote
<form name="commentform" action="details.php?image_id={image_id}" method="post" onsubmit="postbutton.disabled=true;">

and now when I click POST A COMMENT button, it will  insert comment into the diffenren image id, for example: if I am in image_id=1 page , but it will insert comment into some another image like image_id=**. I really can't figure out what did I missing, is there something else I have to change? and also, how to make the popup window return a message after I posted a comment?

Offline VuRaLNeT

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: Need help with new feature [move comment form into a popup window]
« Reply #1 on: February 27, 2013, 11:15:39 AM »
Do you have a working version of this mode? I am unable to set.  :(