Avatar of slightlyoff
slightlyoff asked on

jQuery Auto Complete

I have a jQuery autocomplete function on my website, which works for the most part.  If you type more than 2 letters or numbers, it will return the results.  If I use the up and down arrow keys to highlight the results, the input box (#search) will change it's value to the selected text.  If I use the mouse to click on a result, it gets highlighted, but the value of #search never changes.

here's my code:

$( "#search" ).autocomplete({
			source: "showsearchresults_home.asp",
			select: function( event, ui ) {
				log( ui.item ?
					"Selected: " + ui.item.value + " aka " + ui.item.id :
					"Nothing selected, input was " + this.value );

Open in new window

And the HTML for the search box:

<form name="search_form" id="searchbox" action="#" method="get">
                    	<input id="search" type="text" name="search" />
                        <input id="submit_top" type="submit" value="Search" onclick="this.submit"/>

Open in new window

Any ideas on what I might be doing wrong?

Thank you for your help!!!

Avatar of undefined
Last Comment

8/22/2022 - Mon

out of the code you post you've a event.preventDefault() or similar on a click event : Remove it
Julian Hansen

Can you post a link or full source for the page.
Chris Stanyon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Thank you!  That was what I needed :)
Your help has saved me hundreds of hours of internet surfing.