if we select anything in search box it should Selected in select box.

if we select anything in  search box it should display in select box. please tell me how to set this link with Jquery.
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Autocomplete - Default functionality</title>
  <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <!-- <link rel="stylesheet" href="https:/resources/demos/style.css"> -->
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script>
  $( function() {
    var availableTags = [
      "ActionScript",
      "AppleScript",
      "Asp",
      "BASIC",
      "C",
      "C++",
      "Clojure",
      "COBOL",
      "ColdFusion",
      "Erlang",
      "Fortran",
      "Groovy",
      "Haskell",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
    ];
    $( "#tags" ).autocomplete({
      source: availableTags
    });
  } );
  </script>
</head>
<body>
 
<div  style="float: left;">
  <label for="tags">Search box : </label>
  <input id="tags">
</div>

<div style="float: left;">
  <label for="tags">Select box: </label>
  <select >
    <option></option>
    <option>ActionScript</option>
  </select>
</div>
 
 
</body>
</html>

Open in new window

kumar naikGraphic DesignerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris StanyonWebDevCommented:
You will need to hook into the select event. This fires when you choose an item from the AutoComplete. Give your <select> an ID (i.e #mySelect), and then add in the select event:

$( "#tags" ).autocomplete({
    source: availableTags,
    select: function( event, ui ) {
        $('#mySelect').val(ui.item.label);
    }
});

Open in new window

Obviously, this will only set the <select> if the item exists as an <option>
0
kumar naikGraphic DesignerAuthor Commented:
hi Sir can you give me a sample example so that i can check thankq
0
Chris StanyonWebDevCommented:
Sure - here's a link to a working demo: https://jsfiddle.net/ChrisStanyon/q57eouxv/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kumar naikGraphic DesignerAuthor Commented:
thank u my problem is solved
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

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.