[jQuery] Autocomplete form submit on enter problem?

[jQuery] Autocomplete form submit on enter problem?


Hi
I've implemented the ui.autocomplete to a number of inputs and
textareas on a form, they all work fine and as expected. All except
one, for some reason on one of the autocomplete fields, when I've
scrolled to a value in the list and press enter to select the value,
the form is being submitted.
I'm completely puzzled because this doesn't happen on any of the other
autcomplete fields. Here is the code which initialises the
autocomplete:
$(function(){
    // Set up the requestor field
    requestor_tab.setup();
});
var requestor_tab = {
    setup: function(){
        // Set up the requestor field
        this.requestor_setup();
    },
    requestor_setup: function(){
        // setup the request_for autocomplete
        $('#requested_for').addClass('autocomplete').autocomplete
(settings.users, {
            matchContains: true,
            mustMatch: true,
            minChars: 0
        }).result(function(event, data, formatted){
            if ($(this).val() == settings.cur_requested_for) {
                alert("user is the same");
            } else {
             alert("user is different");
            }
        });
    }
}
I've looked a little deeper and it appears to be something to do with
the alert - when I remove the alert calls, the form doesn't submit.
In the live environment the alerts aren't going to be there so
therefore the problem will disappear but I'd still like to try and
understand why this is happening if possible.
Does anyone have any ideas?
Cheers,
Lee