Discussion:
jQuery AUTOCOMPLETE (by bassistance): submit on click
jjunior
2010-02-18 08:17:33 UTC
Permalink
I'm having a problem with the plugin. Right now, when a user clicks
on a list of suggestions from the autocomplete, it takes that
selection and puts in the input. The user then has to click again or
hit enter to submit the form.

It seems that most search forms work on a single click system: click
on the desired entry in the list and the desired search is executed.

Can anyone offer some assistance?

Thanks!
Rob Lacey
2010-02-18 11:44:34 UTC
Permalink
I'd imagine you'd want something like this?

$('input#query').autocomplete('yoururl',{
.............
your options
.............
}).result(function(event, item, formatted) {
$(this).parents().find('form:first').submit();
});

I hope this helps

RobL
Post by jjunior
I'm having a problem with the plugin. Right now, when a user clicks
on a list of suggestions from the autocomplete, it takes that
selection and puts in the input. The user then has to click again or
hit enter to submit the form.
It seems that most search forms work on a single click system: click
on the desired entry in the list and the desired search is executed.
Can anyone offer some assistance?
Thanks!
jjunior
2010-02-18 19:38:02 UTC
Permalink
That's brilliant! Thanks.

Loading...