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

  • Home
  • SEARCH
  • 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 7578757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:30:17+00:00 2026-05-30T17:30:17+00:00

How to do a doOnce function? I have this jQuery script and I want

  • 0

How to do a doOnce function?

I have this jQuery script and I want to add a doOnce function to it.
I want to click a tag and submit this function database once, but when I do it update the last updated insert not the current one.

Any help would be great.

$("document").ready(function() {
    $(".edit_happening").click(function() {
        var element = $(this);
        var edit_id = element.attr("id");
        var edit_title = $("#edit_title<?php echo $id; ?>").val();
        var edit_start_time = $("#edit_start_time<?php echo $id; ?>").val();
        var edit_end_time = $("#edit_end_time<?php echo $id; ?>").val();
        var edit_description = $("#edit_description<?php echo $id; ?>").val();
        var edit_location = $("#edit_location<?php echo $id; ?>").val();
        var info = "edit_id=" 
            + edit_id 
            + '&edit_title=' 
            + edit_title
            + '&edit_start_time=' 
            + edit_start_time 
            + '&edit_end_time=' 
            + edit_end_time 
            + '&edit_description=' 
            + edit_description 
            + '&edit_location=' 
            + edit_location;

        if (edit_title == 'Edit Happening') {
            $("#errorMsg_edit<?php echo $id; ?>").fadeIn(200).show();
        }
        else if (edit_description == '') {
            $("#errorMsg_edit<?php echo $id; ?>").fadeOut(200).hide();
            $("#errorMsg2_edit<?php echo $id; ?>").fadeIn(200).show();
        }
        else {
            $.ajax({
                type: "POST",
                url: "/happening_edit.php",
                data: info,
                cache: false,
                success: function(html) {
                    $("#title<?php echo $id; ?>").html(edit_title);
                    $("#happening_edit_info<?php echo $id; ?>").fadeOut(200).hide();
                    $("#happening_info<?php echo $id; ?>").fadeIn(200).show();
                    $("#happening_msg_edit<?php echo $id; ?>").show();
                    setTimeout(function() {
                        $("#happening_msg_edit<?php echo $id; ?>").fadeOut(200).hide();
                    }, 3000);
                }
            });
        }
        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-05-30T17:30:18+00:00Added an answer on May 30, 2026 at 5:30 pm

    Need more details to accurately answer, but:

    http://api.jquery.com/one/

    $( '#something' ).one( function(){
       ...
    } );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a postgres database with a table that contains rows I want to
This is what I am trying to do: Once submit a form on my
I have UITableView which contains cells. what I would like to do once user
I found this code to display a modal view: - (void)add:(id)sender { // Create
I plan to submit my first iPhone game to the iPhone app store today.
I am using the PHP library for the Graph API ( http://github.com/facebook/php-sdk ) but
I'd like to use jQuery's auto complete in a Drupal project to automatically find
I am a little confused here. I would like to do something like this:
My ListView is linked to the database (with SimpleCursorAdapter ). What should I do
This question is motivated by something I've lately started to see a bit too

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.