Skip to content Skip to sidebar Skip to footer

How To Make Jquery Autocomplete Execute A Search() When User Hits Submit

As a follow on my from last post - How would I trim the input to a JQuery auto-complete box? . I decided to make a new question rather than to continue editing that one. I currentl

Solution 1:

You need to add the automated-choose-any-matching-result code in the change event.

Check my answer on your other question: jQuery autocomplete problem - doesn't match if user doesn't specifically select

Solution 2:

I have both answered my own question, and also discovered that search() doesn't work like I thought. I tried:

    <inputid="Submit" name="Submit"type="Submit"class="Submit" value ="Submit" onclick="jQuery('#Resource').autocomplete('search');"/>

And discovered that a second before the form finishes submitting, the auto-complete box flashes up. Obviously search() just makes the auto-complete box do a normal search, not an automated-choose-any-matching-result search, which is what I was looking for.

Post a Comment for "How To Make Jquery Autocomplete Execute A Search() When User Hits Submit"