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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:39:33+00:00 2026-06-13T20:39:33+00:00

I have implemented an auto complete event using Jquery , and it works fine,

  • 0

I have implemented an auto complete event using Jquery, and it works fine, now I need to implement a remove or delete functionality in the list I selected.
pls see the code below.

    $(function() {
      function log( message ) {
        $( "<div>" ).text( message ).prependTo( "#log" );
        $( "#log" ).scrollTop( 0 );
    }

    $( "#poolName" ).autocomplete({
        source: function( request, response ) {
            $.ajax({
                url: "/DataWeb/getPoolName",
                type : 'post',
                dataType: 'json',
                data: { name_startsWith: request.term },
                success: function( data ) {
                    console.log(data);
                     response( $.map( data, function( item ) {
                        return {
                             label: item.poolName,
                             value: item.poolName
                        }
                    })); 
                }
            });
        },
        minLength: 2,
        select: function( event, ui ) {
            log( ui.item ?
                "Selected: " + ui.item.label :
                "Nothing selected, input was " + this.value);
        },
        open: function() {
            $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
        },
        close: function() {
            $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
        }
    });
});

Ex : in the textBox if i type ‘a’ I get list of names starting with ‘a’, and I select 5 names starting with ‘a’. It will be stored in “log” id.

Pool Name:

            <div style="margin-top: 2em; font-family: serif; font-size: medium;"> Result: 
                 <div> <fieldset id="log" style="height: 200px; width: 300px; overflow: auto;"> </fieldset> </div> 
            </div> 
        </div>
    </form>

Now if i want to remove one of the name selected, how do i need to implement??
can anyone help??

Thanks in advance

  • 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-13T20:39:34+00:00Added an answer on June 13, 2026 at 8:39 pm

    Change your log function to:

    Note: This adds a “Remove” button in front of each message, which will delete the message when clicked.

    function log( message ) {
        var _m = '<div style="float:left;">' + message + '</div>';
        _m += '<div style="float:right;"><input type="submit" value="Remove"></div>';
        _m += '<div style="clear:both;"></div>';
    
        $( "<div>" ).html( _m ).prependTo( "#log" ).click(function(o){
            $(this).remove();
        });
        $( "#log" ).scrollTop( 0 );
    }
    

    Hope this helps.

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

Sidebar

Related Questions

I have implemented the auto complete functionality using the Ajax.autocompleter function of the Scriptaculous
I am trying to implement auto complete via jquery auto complete plugin. I have
I have implemented an auto-complete search on my website using ajax autocomplete control.It uses
Hi I have been trying to implement auto complete in my site from 2
I have implemented the mCustomScrollbar plugin in my backoffice interfaces. It works fine. But
I have implemented autocomplete using Jquery. I have also implemented highlighting the matching text.
I have implemented a jquery ui autocomplete with data from database. Right now what
I have implemented the jquery autocomplete combobox, however the change event does not seem
I have implemented the jquery ui autocomplete as in the example: autocomplete with custom
I have implemented Facebook into my app but now I find that whenever 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.