Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamic hide reveal
    primarykey
    data
    text
    <p>I'm working on a blog and I have it set up so you can leave a comment on an entry. I don't like how much vertical space all the comments and the entry form use, so I would like to have a link on each entry that you click and it reveals the entry form and comments. I'm thinking a link that's like "Comments (5)". I see this all the time on other sites but I don't know how to create it myself. </p> <p>This is some of the HTML for one of the entries:</p> <pre><code>&lt;div class="comments"&gt; &lt;form action="foxpost.php" method="post"&gt; &lt;label for="name"&gt;Name&lt;/label&gt;&lt;br&gt; &lt;input id="name" name="name" type="text" /&gt;&lt;br&gt; &lt;label for="message"&gt;Comment&lt;/label&gt;&lt;br&gt; &lt;textarea class="message" id="message" name="message"&gt;&lt;/textarea&gt;&lt;br&gt;&lt;br&gt; &lt;input type="hidden" name="post_id" value="7" /&gt; &lt;input type="Submit" value="Post Comment" /&gt; &lt;/form&gt; &lt;?php displayComments(7); ?&gt; &lt;/div&gt; </code></pre> <p>The displayComments(); function is just the PHP that pulls the comments from the database.</p> <p>The only thing I can think of is to change the to and use a different ID (such as "comments2","comments3", etc.) for each comments area, then use a javascript function involving document.getElementByID().style.display to alter a different CSS entry for each "commentsX" div. That just seems bloated though, so I'm wondering if there's an easier way to dynamically reveal and hide my form and php function that grabs the comments.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload