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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:14:12+00:00 2026-05-29T06:14:12+00:00

I need to get comment id when clicking to report button (I want to

  • 0

I need to get comment id when clicking to report button (I want to get comment-6)
Now when I click ‘report’ it show a modal box with form.

    <div class="comment-box medium-comment" id="comment-6">
        <div class="photo-box">
        <img src="img/samples/photo_1.jpg" alt="" class="photo rounded"/>
        <a href="#" title="" class="corner rounded"></a>
        </div>
        <div class="avatars">
        <a href="#" title="">
            <img src="img/samples/followers/1.jpg" alt=""/>dearskye
        </a>
        <span>commented on</span>
        <a href="#" title="">
            <img src="img/samples/followers/2.jpg" alt=""/>Antony12
        </a>
        </div>
        <div class="comment rounded">
        <div class="bg-tl"></div>
        <div class="text">Happy golden days of yore
                  Happy golden days of yore Happy golden days 
             of yore</div>
        <div class="buttons">
           <a href="#" title="" class="report">REPORT</a>
        </div>
        </div>
        <div class="cinfo">
        2 дня назад
        </div>
        <div class="both"></div>
    </div>

clicking to

<a href="#" title="" class="report">REPORT</a>

call jquery

jQuery('a.report').bind('click', function(event) {
    showModalWindow('report-window');
});

and function is

function checkReportForm(form)
{
var result=true;
var select=jQuery("#report-window select");
var textarea=jQuery("#report-window textarea");

if(textarea.hasClass('default'))
{
    //Save placeholder
    textarea.data('placeholder', textarea.text());
    textarea.toggleClass('default');
}
textarea.attr('class','rounded');

if(select.val()==0)
{
if(textarea.val()==''||textarea.val()==textarea.data('placeholder'))
{
    result=false;
    textarea.toggleClass("alert");
}
}
if(result)
{
closeModalWindow('report-window');
}

I tried to do it but nothing. I suppose it is possible otherwise will think to change code. I hope someone will help me.

  • 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-29T06:14:14+00:00Added an answer on May 29, 2026 at 6:14 am

    You can use closest to get the closest element which cotains the required class and get its id. Try this.

    jQuery('a.report').click(function() {
        var $commentBox = $(this).closest(".comment-box");
        var id = $commentBox.attr('id').replace('comment-', '');
        alert(id);//It will alert the comment id
    
        //Store the comment id in report window
        $('#report-window').data('commentid', id);
    });
    

    Now use $('#report-window').data('commentid') to get the current comment id inside checkReportForm method.

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

Sidebar

Related Questions

I need to get a comment of the particular function in php class, for
I need to get a list of Articles sorted by the latest Comment from
I need to get the number of items that have a comment but I
I need to get string from comment in HTML file, I was trying to
Just need get some vals located in application.ini(main ini) in the Controller plugin I
I need get all items these have no categories int? categoryId = null; var
I'm working with C#.net developing applications for windows mobile 6, and i need get
I have two tables with a weak relation. I need get a text value
Need to get the 10 word before and 10 words after for the given
I need to get the default printer name. I'll be using C# but 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.