How To Add Search Button To Jquery Autocomplete

This is my blog.

The above is the code which i have executed in my blog.

<!doctype html>
Jquery Auto Complete

  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js">
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js">

  <script>
  $(document).ready(function() {
    $("input#autocomplete").autocomplete({
    source: [
             { value: "NYC", url: 'http://www.nyc.com' }, 
             { value: "LA", url: 'http://www.la.com' },
             { value: "Philly", url: 'http://www.philly.com' },
             { value: "Chitown", url: 'http://www.chitown.com' },
             { value: "DC", url: 'http://www.washingtondc.com' },
             { value: "SF", url: 'http://www.sanfran.com' },
             { value: "Peru", url: 'http://www.peru.com' }
        ],
        select: function (event, ui) {
            window.location = ui.item.url;
        }

});
  });
  </script>



<input id="autocomplete" />


</!doctype>

My problem is when ever i click the tags it is redirecting to other page it is ok what i want but my main aim is to put search button beside the text field after selecting tags

then if clicked the search button then the tags should be redirected to that website i hope my question is clear

[quote=“VIJAY_KUMAR, post:1, topic:228509, full:true”]
My problem is when ever i click the tags it is redirecting to other page[/quote]

Remove the select function to stop it redirecting to the other page. It’s the window.location part that performs the redirect.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.