When press on a link on my page one text area opens and the others close

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Yousef Altaf
    New Member
    • Jun 2011
    • 22

    When press on a link on my page one text area opens and the others close

    I have many text area in one page I get them by a link called "comment" so her is the idea I made a code in php that includes a form when the user clicks on "comment" this is an Ex.

    Code:
    if(isset($_GET['comments'])) { $comments = $_GET['comments']; } if (!isset($_GET['comments'])) { $comments = ""; } if ($comments == "ok") {
    
                              echo "<tr><td colspan='6' align='center'>";
                              echo "<span class='rePost'>Re : &nbsp;</span><span
    
        class='blogerName'>$blog->ByName"; include "postComments.php"; echo "";
    
                             } ?>
    now when the user clicks on comment it just includes the comment text area but here there is more then one threads on the same page or I can say more then one post on the same page so when the user clicks on "comment" on post one all the other posts get the text area below it. what I need here is when the user clicks comment on post "1" the text area appear below post "1" and not 2 or 3 or any other one on this page. I hope I got you to the point that I want.
  • John Doe
    New Member
    • Jun 2011
    • 20

    #2
    Yousef, send us a screenshot, and a larger block of your code.

    Basically, on your 'comment' links you need to be specifying the id of the post you are commenting on.

    Then, in your loop that displays each post, you need to check if the comment id matches the id of the post you are displaying. If so, show the comment form.

    Comment

    Working...