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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:45:16+00:00 2026-05-11T08:45:16+00:00

alert(data going into $hidden: + selected.data[1]); hidden.val(selected.data[1]); alert(data now in $hidden: + $hidden.val()); What

  • 0
alert('data going into $hidden: ' + selected.data[1]);  hidden.val(selected.data[1]);  alert('data now in $hidden: ' + $hidden.val()); 

What would be a reason that $hidden.val() in the last line above would return undefined? I have verified that selected.data[1] contains an integer value.

Edit #1: Some additional context per comments: ($hidden is a hidden input field)

$.fn.extend({     autocomplete: function(urlOrData, hidden, options) {         var isUrl = typeof urlOrData == 'string';         var $hidden = $(hidden);         options = $.extend({}, $.Autocompleter.defaults, {             url: isUrl ? urlOrData : null,             data: isUrl ? null : urlOrData,             delay: isUrl ? $.Autocompleter.defaults.delay : 10,             max: options && !options.scroll ? 10 : 150         }, options);          // if highlight is set to false, replace it with a do-nothing function         options.highlight = options.highlight || function(value) { return value; };          // if the formatMatch option is not specified, then use formatItem for backwards compatibility         options.formatMatch = options.formatMatch || options.formatItem;          return this.each(function() {             new $.Autocompleter(this, options, $hidden);         }); 

and…

$.Autocompleter = function(input, options, $hidden) {         //...           function selectCurrent() {             var selected = select.selected();             if (!selected)                 return false;              var v = selected.result;             previousValue = v;              if (options.multiple) {                 var words = trimWords($input.val());                 if (words.length > 1) {                     v = words.slice(0, words.length - 1).join(options.multipleSeparator) + options.multipleSeparator + v;                 }                 v += options.multipleSeparator;             }               alert('data going into $hidden: ' + selected.data[1]);              $hidden.val(selected.data[1]);              alert('data now in $hidden: ' + $hidden.val()); 

Edit #2: More details…. I’m trying to use the jQuery autocomplete extension on a form with multiple textbox controls (each implement the autocomplete). There’s a seperate button on the form beside each textbox that submits the form to a handler function that needs to find the value of the item selected and save it to the db. The way I thought to go about this was to include a hidden field on the form to hold the selected value.

  • 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. 2026-05-11T08:45:17+00:00Added an answer on May 11, 2026 at 8:45 am

    Thanks Paolo Bergantino. I discovered that I wasn’t passing the initial hidden in with a # in front of the hidden field id, so $hidden was never getting set properly. It was difficult for me to debug because the the autocomplete is inside an ascx control as an embedded resource. Once I ensured that the value of hidden was including the # it worked properly.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer See this: DisplayObject to JPEG or PNG with IImageEncoder May 11, 2026 at 9:13 pm
  • Editorial Team
    Editorial Team added an answer I wouldn't use a temp table. My guess is that… May 11, 2026 at 9:13 pm
  • Editorial Team
    Editorial Team added an answer Seems to be impossible May 11, 2026 at 9:13 pm

Related Questions

I know this seams a trivial question, but how can I disable the annoying
I have a simple form that is used to update an entity in my
Scenario: I have a partial view that is used in several places across my
I have a jQuery .ajax call: $j.ajax({ type: POST, url: /Services/Cart.asmx/UpdateQuantity, data: data, contentType:

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.