I've been at this for hours now and not the first clue why my code isn't working. If you check out my site at http://www.confessmyshit.com you would see people's confessions and at the bottom of each there's a link for Comments that if you click it should display the comments and a place to post your own directly under that comment. Unfortunately the code only works for the first comment on the index.php page. Here's the code I have atm: <a href='javascript:popComm(".$row['id'].")'>Comments (".$row['comms'].")</a> Code (markup): where $row['id'] is the confession to display comments to and $row['comms'] is how many comments are posted for each confession. then under the round-cornered box for each confession i have this html which is inside a php echo command (where # is the comment id to display the comments for): <div id='comments'> <div id='comments".$row['id']."'> <img src='images/tcomm.png'> <?php include('dispComm.php?id=".$row['id']."'); ?> <img src='images/bcomm.png'> </div><!-- comments# --> </div><!-- comments --> Code (markup): which has this css code applied to it: #comments { display:none; width:700px; } Code (markup): Then there's the javascript that should be making 'comments' and 'comments#' visible (where # is again the id of the confession to display comments for): function popComm(which) { var area = document.getElementById('comments'+which); var other = document.getElementById('comments'); if(area.style.display=="inline") { area.style.display = "none"; other.style.display = "none"; } else { area.style.display = "inline"; other.style.display = "inline"; } } Code (markup): can anyone help me out?
do I need to register before I comment. When I tested it does not work for any comments not even for the first comment as you said.. by the way are using any content management system for this ?
no there's no need to register. the dispComm.php page hasn't been made yet, i'm trying to fix the popComm() part right now. the first one doesn't even work for you? Which browser are you using? What do you mean by content management system? confessions and comments will be stored in separate tables in a mysql database. i forgot to mention that the first code segment with the link to pop open comments is also in a echo, if that helps at all