Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5937709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:34:51+00:00 2026-05-22T15:34:51+00:00

I have a while statement that is echoing about 10 different stories. Every story

  • 0

I have a while statement that is echoing about 10 different stories. Every story has a user comment. When clicking the button edit I want one of the functions to hide the user comment. Here is the code I wrote to try and make it happen. Let me know if you think of why this wouldn’t work.

<script>
    $(".edit_<?php echo $story_id ?>").click(function () {
    $(".comment_<?php echo $story_id ?>").hide("fast");
     });    
</script>
<?php
if (!empty($user_comment))
echo "
<p class='user_comment comment_$story_id'><strong>$user_comment</strong> <a class='edit_story_comment edit_$story_id'>Edit</a></p>";
else
echo "<p id='user_comment_$story_id'><span id='edit_no_story_comment'>Edit</span></p>";
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:34:51+00:00Added an answer on May 22, 2026 at 3:34 pm

    so im gonna ges its becuse of the ankertag is being defined after you are
    hocking upp the event with jquery

    use jquerys on load event to get around this

    $(function() {
     $(".edit_<?php echo $story_id ?>").click(function () {
      $(".comment_<?php echo $story_id ?>").hide("fast");
     });    
    });
    

    hope this help

    (mixing php html and jquery and string concatenation is beautiful btw :D)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a sql statement that pulls infomration about tagnum's for individual pidm's. Every
Given that Groovy does not have a do-while statement, how can I iterate over
I have a do while that looks like: User user = userDao.Get(1); do {
I have an if/else statement that is not working. while (rdr.Read()) { string permission
I have a while statement that's executing correctly but it needs to be a
I have this SQL statement that works but takes a while to execute I
I want to update a table in a statement that has several joins. While
What I want to do is have a while statement which loops whilst the
I have some codes read the query results from sqlite: while (sqlite3_step(statement) == SQLITE_ROW)
Using parent child relationship where a parent can have children while each child has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.