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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:55:06+00:00 2026-05-28T03:55:06+00:00

Hi I have dynamically added functionality like adding a customer to a customer list

  • 0

Hi I have dynamically added functionality like adding a customer to a customer list appear in mouse over event . it has add new list item and once the user clicks it a textbox appears and once the user enters valid content it adds the newly entered item to the list saves it and displays the newly added thing with a tick. and when a user click on already ticked item it deletes from the list .

when i implement this functionality locally we can add a customer to many lists from one try . but when i upload the application and try it it saves a new customer group but when i trying to add more from a one shot it only added the last one. the previously added customers key is going with the request . if the customer s key already available it deletes the customer from the group which already being added . this works more like facebook’s friend list which you can find in friends page we can add friends to different lists.

is there a way to synchronize jquery ajax requests . can any one help?

$('.newcustomerlist').live("keypress",function (event) {
    var element_id = $('.custitem').attr('id');
    var customer_key = null;
    var url_key = null;
    if (element_id != null) {
        customer_key  = element_id.split('#')[0]
        url_key = element_id.split('#')[1]
    } else {
        url_key = $(this).attr("id");
    }

    if(event.which == '13') {
        var cust_list_name = $(this).val().trim();
        var val = (/^[a-zA-Z ]*[-a-zA-Z0-9_ ]+$/).test(cust_list_name);
        if(val){
            $.ajax({
                type : "GET",
                url : "/addcustomerfromhere/",
                data : "cust_list_name=" + cust_list_name,
                success : function (msg) {
                    new_customer_key  = msg.customer_key ;
                    $.ajax({
                        type : "GET",
                        url : "/addcustomertolist/",
                        data : "url_key=" + url_key + "&customer_key =" + new_customer_key ,
                        success : function (data) {
                            $("ul.custlist").prepend("<li id="+ new_customer_key  + "#"+ url_key + " class='custitem addedtocust'><span>" + msg.cust_list_name + "</span></li>");
                            $(".title").show();
                        },
                        error : function (XMLHttpRequest, textStatus, errorThrown) {
                            $.notify({message: 'Apologies. Our servers are busy at this moment. Please try again later.', type: 'error'});
                        }
                    });
                },
                error : function (XMLHttpRequest, textStatus, errorThrown) {
                    $.notify({message: 'Apologies. Our servers are busy at this moment. Please try again later.', type: 'error'});
                }
            });
        $(".addnew").show()
        $(".newtext").hide()
        } else {

        }
    }
});
  • 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-28T03:55:07+00:00Added an answer on May 28, 2026 at 3:55 am

    you could add this to the ajax options:

    async:false
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with dynamically added script element (using jQuery). Code for adding
I have a ListView in my project that has dynamically added/edited/deleted items. When the
I have JPanel has already added to JFrame. And I have dynamically added JPanel.
I have a dynamically added list on the home of my jQuery Mobile Page.
I have a list of tab items that have views dynamically added to them.
I have a nested sortable list that can have items dynamically added or removed
Often times I have elements hooked to added functionality, like: $('.myfav').autocomplete(); $('.myfav').datepicker(); $('.myfav').click(somefunction); But
I have this code $(.delete2).click(function() { $('#load2').fadeIn(); } I have dynamically added item via
I have a form where controls are dynamically added to a Panel. However, when
I have a page with some dynamically added buttons. If you click a button

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.