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 8729501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:50:45+00:00 2026-06-13T08:50:45+00:00

I have a comment system in which i want to add delete option, for

  • 0

I have a comment system in which i want to add delete option, for this i have implemented a POST form in each comment which posts comment-id to delete.php, it is working in php, but not in jquery.

i.e in order to delete comment a comment id must be posted to delete.php file which handles deletion of comment from database.

i am trying to fetch that comment-id from input value to post with jquery like this but it gives me the first comment-id value not the selected value.

Jquery

    $('form[name=comments]').submit(function(){

    var comment_delete = $("input[name=comment-delete]").val();
    //$.post('../../delete.php', {value1:comment_delete}, function(data){alert('deleted')});
    alert(comment_delete);
    return false;

    });

repeating form is like this

      <form name="comments" action="../../delete.php" method="post">
      <input name="comment-delete" type="hidden" value="<?php echo $list['comment-id']; ?>" />
      <input value="Delete" type="submit" />
      </form>

if i use .each() or .map() it gives me all the comment-id values.

Please see and suggest any possible way to do this.

Thanks.

  • 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-06-13T08:50:46+00:00Added an answer on June 13, 2026 at 8:50 am

    To find the relevant input, that is the one of the form you submit, you could use this :

     $('form[name=comments]').submit(function(){
        var comment_delete = $(this).find("input[name=comment-delete]");
    

    BTW, I’m not totally sure of what you do but you might be missing a .val() to get the value of the input.

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

Sidebar

Related Questions

I have a system of comments, and each comment has a button that normally
I have a micropost/messaging system and each time a new micropost or comment/message is
I have a post system in place <?php /** Display the results from the
I have a paging system implemented for user comments and depending on which page
We have a system in which we want to maintain stats on large volumes
I want to create a system for users to comment on posts where comments
I have Comment as a polymorphic model. It is attached to Post, Review, etc.
I have a Comment class with a :foreign_key of post_id in the Post class.
I have this string: comment_1234 I want to extract the 1234 from the string.
I have been looking for a proper comment system for my blogging site. I

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.