jquery autocomplete combobox - how to show/hide divs on select

jquery autocomplete combobox - how to show/hide divs on select

Hey everyone,

I got the autocomplete combobox up and running but i wonder how i can show/hide divs on selecting an option from the dropdown list? There seems to be an issue combining the combobox with a show/hdioe script like this:

$(document).ready(function() {
    $('#combobox').change(function() {
        dropdown = $('#combobox').val();
 
        $('#message1').hide();
        $('#message2').hide();
 
        if (dropdown == 'Java')
        {
           $('#message1').show();
        }
 
        if (dropdown == 'Perl')
        {
           $('#message2').show();
        }
    });
});

Thanks