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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:50:12+00:00 2026-06-09T12:50:12+00:00

I am working on a gallery with comment system. It means when I click

  • 0

I am working on a gallery with comment system. It means when I click on next and previous then the new pic with its comments are loaded. But the problem is that I am using a commentbox in which when I open a pic and submit comment for it, it submit the same comment only one time (the way it should work), but when I click on next pic (pic 2) and submit comment for it, the comment is submitted two times (instead of one), and the third pic three times and so on. Here is my jquery code hope someone help me with this

$('body').on('keyup', '#stg_cmtarea', function(e) {

    if (e.which == 13 && $.trim(this.value).length) {
        var picId = $(".gal_cmt_cnt_info").attr('gdata');
        var userId = $("#mipicview-overlay-content").attr('vwid');
        var comment = $("#stg_cmtarea").val();
        var dataString = 'comment=' + comment + '&pic_id=' + picId + '&user_id=' + userId;
        if ($.trim(comment).length == 0) {
            alert("Please Enter Comment Text");
        }
        else {
            $.ajax({
                type: "POST",
                url: "modules/gallery/piccomment_ajax.php",
                data: dataString,
                cache: false,
                success: function(html) {
                    alert(html);

                }
            });
        }
        return false;
    }
});​
  • 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-09T12:50:14+00:00Added an answer on June 9, 2026 at 12:50 pm

    I don’t see anything wrong with this code. It shoulds like you are rebinding the keyup event every time, and the event is just getting bound to the comment box too many times.

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

Sidebar

Related Questions

I am working on a photo gallery, each thumbnail is in its own DIV
I'm working on some kind of gallery. Found cool ready solution but i want
Working on an image gallery, but it keeps crashing on me (you control it
I am working on implementing a gallery, I tried GridFieldManager for this, but the
I am working on a new project which requires a image gallery as well
I love the Slider Gallery on http://jqueryfordesigners.com/slider-gallery/ , but unfortunately it stopped working after
I am working on a overlay + gallery plugin. But I am stuck at
Can't seem to get this jquery gallery working. I've been able to get the
I'm currently working on a gallery to my photos. Besides some bugs, I'm finished
i'm working on a slide gallery at the moment. My problem is that when

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.