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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:39:33+00:00 2026-05-26T09:39:33+00:00

I having trouble cause I am fetching some text from the db(mysql), that text

  • 0

I having trouble cause I am fetching some text from the db(mysql), that text is supposed to be filled with the autocomplete but Its retrieved from the db, now when I want to use that text with the autocomplete does not work, I need to take the id(ui.item.id) of the text without using autocomplete, I thinks Its a problem with the event that fires autocomplete (.bind) but I dont know how to fixed, any advise please help? I am stuck

this is my code:

var ids = [];
$(function() {
    function split(val) {
        return val.split(/,\s*/);
    }

    function extractLast(term) {
        return split(term).pop();
    }

    $("#txtdestino_Email").bind("keydown", function(event) {
        if (event.keyCode === $.ui.keyCode.TAB && $(this).data("autocomplete").menu.active) {
            event.preventDefault();
        }
    }).autocomplete({
        source: function(request, response) {
            $.getJSON("../../correo/controller/controllerAutocomplete.php", {
                term: extractLast(request.term)
            }, response);
        },

        focus: function() {
            return false;
        },
        select: function(event, ui) {
            var terms = split(this.value);



            terms.pop();
            // add the selected item
            terms.push(ui.item.value);
            // add placeholder to get the comma-and-space at the end
            terms.push("");
            this.value = terms.join(",");

            ids.push(ui.item.id);
            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-26T09:39:34+00:00Added an answer on May 26, 2026 at 9:39 am

    jQuery AutoSuggest by Dew wilson have the following options for selecting values

    ‘selectedItemProp’ and ‘selectedValuesProp’ in which the selectedValuesProp is used to select the values, for example for a name value collection, this option is used for values and the other selectedItemProp is used for names. ‘asHtmlID’ option helps to set HTML ID of the element. Finally the pluggin renders a hidden field with ID as_values_’CUSTOM_ID’ which holds the values selected where ‘CUSTOM_ID’ is the ID set to ‘asHtmlID’ option

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

Sidebar

Related Questions

I am having trouble with a jQuery script.. The script displays posts from Mysql
I'm doing some contribution to an open source library, but I'm having trouble modifying
I'm having trouble with an app that runs on IIS 6, but not IIS
Having trouble with proper regex for RewriteCond RewriteCond %{REQUEST_URI} !^/foo/ Works as expected, that
I was having trouble determining what was cause my form to not submit when
I'm having trouble pinning down the cause of a RuntimeException in a Wicket application.
I am having trouble creating a Web Service in Java that contains two methods
I'm having a lot of trouble with Ruby after coming back to it from
I'm having some trouble with a jquery script I'm writing, as I cannot get
I'm having trouble finding a solution to this via google but I would have

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.