JQuery Autocomplete: Submit Form on selection?

前端 未结 5 1601
后悔当初
后悔当初 2020-12-24 12:50

Using JQuery Autocomplete on a traditional HTML form.

Trying submit the form (the old-fashioned way) when a selection is made.

But the input box gets filled

5条回答
  •  时光取名叫无心
    2020-12-24 13:56

      select: function( event, ui ) {
    
              if(ui.item){
    
               $(event.target).val(ui.item.value);
    
        }
    
               $(event.target.form).submit();
    
                      });
    

提交回复
热议问题