Issue #24
Closed this issue · 2 comments
As you know, we did not ask you to provide these answers for free; our reason for getting in touch with you directly was to pay for your advice; we posted these to Github as per your request.
I don’t mean to be rude, but your current issue (as well as the one before that)
really don’t have anything to do with my plugin. Please post your question on
a Q&A board like Stackoverflow or hire a web developer to help you out.
Problem solved: Using this code (which simulates the 'enter' keystroke), the button accepts the suggestion, runs the query through the validator and submits if the keyword is in the list.
$("#button").click(function() {
e = jQuery.Event("keyup");
e.which = 13 //enter key
jQuery('input').trigger(e);
});
Our current implementation required we triggered an enter twice:
$("#button").click(function() {
e = jQuery.Event("keyup");
e.which = 13 //enter key
jQuery('input').trigger(e); // accept suggestion
jQuery('input').trigger(e); // submit
});