Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm having a posting function like Facebook (post a text, publish a text) and a comment function where you can comment the post. Everything works fine but something disturbs me. If you get the link from the accordingly post, then under every post an Textbox appears, not only under the post where you clicked "comment/answer".

Of course I could tell the user that he needs to write the comment under the post where he clicked. But I think this is really laborious. Also I have a Javascript function entering symbols, if you clicked on it. But this doesn't work. I think that the problem is that under every post a textbox appears. That's the code.
PHP
$exampleid = "7";
  echo '<a href="link.php?id='$exampleid'"><input type="submit" id="answer" name="answer" value="Antworten"></a><br>';

And this is what showes up if you click on the link
HTML
<form action="" method="post"><textarea name="textfield" id="textfield"></textarea>
<input type="submit" name="send" id="send" value="send"/></form>


The construct is like this:
PHP
*Show posts*{ *answer comment*{(with display box for answer comments)}  }


I don't want to locate user to another side for comment the post :( Also I don't know, if the comment would insert the post_id into the database than, which is necessary.

What I have tried:

I've tried it with css, like this:
CSS
text-align: center;
but this just centers the text, not showing the textarea once, and only once under the post you have clicked. Any ideas? I'm thankful for every answer :)
Posted
Updated 15-Jan-22 3:06am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900