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.
$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
<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:
*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:
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 :)