Try binding the handler to the .change() event in the select instead.

On Dec 18, 1:51 pm, Ray Myers <effex...@gmail.com> wrote:
> I'm working on this interface where there are three select elements.
> When an option in the first menu is clicked this code executes
>
> ==========
>
> $('.state_select OPTION').livequery('click', function() {
>         var el = $(this).parent();
>         if ( $(el).val() != 'all' ) {
>         $.post('includes/tools.php', { get_counties: $(el).val(), catgry: $
> (el).parents('.target_form').find('#category').val() }, function(data)
> {
>                 if ( data == "" ) {
>                         alert('No results.');
>                 } else {
>                 alert(data);
>                 
> $(el).parents('.target_form').find('#county').html(data).removeAttr
> ('disabled');
>                 }
>                 }); //End POST
>         } // End if
>         return false;
>
> }); //End .state_select OPTION CHANGE
>
> =============
>
> This does what it's supposed to, generate and load a set of options to
> add to the next select element and enable it. The problem is it's
> adding the list twice.
>
> I added the alert for testing and it only shows the code once. I have
> no idea whats happening here.
>
> Thanks
> - Ray

Reply via email to