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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:20:21+00:00 2026-05-13T10:20:21+00:00

I am using jQuery autocomplete from here : http://www.pengoworks.com/workshop/jquery/autocomplete.htm $(#TestTextbox).autocomplete( ‘<%= Url.Action(LookupAction) %>’, {

  • 0

I am using jQuery autocomplete from here : http://www.pengoworks.com/workshop/jquery/autocomplete.htm

        $("#TestTextbox").autocomplete(
                '<%= Url.Action("LookupAction") %>',
                {
                    delay:10,
                    minChars:1,
                    matchSubset:1,
                    cacheLength:0,
                    onItemSelect:selectItem,
                    onFindValue:findValue,
                    formatItem:formatItem,
                    autoFill:false
                }
            );

function findValue(li) 
{
        if( li == null )       
            return alert("No match!");

        if( !!li.extra ) 
            var sValue = li.extra[0];
        else 
            var sValue = li.selectValue;

       alert(sValue);
}

function selectItem(li) 
{
        findValue(li);
}
function formatItem(row) 
{
        return row[0]; //value
}

the LookupAction return key|value list.
if I add some button, to get the key for selected value in autocompleter, i’ll have something like this :

function lookupAjax()
{
        var oSuggest = $("#TestTextbox")[0].autocompleter;
        oSuggest.findValue();

        return false;
}

while i can see key for entered to textbox values via alert functions in findValue function, the question is : it possible to return them from there somehow ? (i.e. var retVal = oSuggest.findValue())

Thank You !

  • 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-13T10:20:22+00:00Added an answer on May 13, 2026 at 10:20 am

    Have you tried this?

    function findValue(li) 
    {
            if( li === null ){           
               alert('No match found!');
               return false;
            }
            return ( !!li.extra ) ? li.extra[0] : li.selectValue; 
    }
    

    Please note that the notation I have used at the end of the function is called “ternary”. You can find more information about it here.

    EDIT: Try this

    Put this on the page somewhere

    <input type="hidden" id="id_of_hidden_text_field" />
    

    Then change findValue to this

    function findValue(li) 
    {
            if( li === null ){           
               alert('No match found!');
            }
            $('#id_of_hidden_text_field').val(( !!li.extra ) ? li.extra[0] : li.selectValue); 
    }
    

    Now you can refer to the chosen ID by referring to $('#id_of_hidden_text_field').val();

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

Sidebar

Ask A Question

Stats

  • Questions 295k
  • Answers 295k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It's stored in the operating system's disk cache in memory… May 13, 2026 at 6:53 pm
  • Editorial Team
    Editorial Team added an answer I would advise against denormalizing in your situation. You'll get… May 13, 2026 at 6:53 pm
  • Editorial Team
    Editorial Team added an answer Intent. Other people modifying your code won't change values they… May 13, 2026 at 6:53 pm

Related Questions

All, I am using the JQuery Autocomplete Plugin 1.0.2 in a JQuery UI Dialog.
I searched all over this site and the web for a good and simple
Am a bit confused here, what does the formatResult and formatItem do in the
I am using jQuery.autocomplete(1.02) on my search box and I want exact string and
I am using jQuery autocomplete pluggin . I have the following code $().ready(function() {

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.