• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 439
  • Last Modified:

jquery autocomplete function

I have the autocomplete function working properly, in that I can send in my terms and return my JSON (to perl).
Here is the JSON I am getting back from my database query via the autocomplete field:
[{"empid":"A9DDDB08-DBF4-4BC0-9F07-E48F08221FBA","value":"David Smith"}]

Here is the jquery/HTML on my page
$(function() {

$( "#tags" ).autocomplete({
source: "../f/getnames2.pl",
minLength: 2,
dataType: "JSON"
<div class="ui-widget">
<label for="tags">Name: </label>
<input id="tags" />

Open in new window


My question is this. How can I get the value of empid from my json to be associated with the value that is returned from auto-complete?
I  need to use the value of empid in another database query so I need to return it when the form is submitted.
I don't really know jquery, I've been trying various things but nothing is working.

1 Solution
jorge_torizResearch & Development ManagerCommented:
$( "#tags" ).autocomplete({
  select: function( event, ui ) {

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now