Actually the first time autofilling works. When I open the dialog a second time, then auto-complete does not work anymore.

var create_product = function () { isEdit = false; $(".dialog_create_product").dialog({ autoOpen: true, width: 800, modal: true, buttons: {}, open: function (event, ui) { $( ".getInputComponent" ).autocomplete({ source: ['1','2','3'], }); }, close: function (event, ui) { $(".dialog_create_product").dialog("destroy") }, beforeClose: function (event, ui) { closeDialog(); } }); }; 

html

  <div class="divInput"align="center"> <input class = "getInputComponent" placeholder="название компонента" type="text" maxlength="50"><button class="addComponent" >Добавить компонент</button> </div> 
  • how can I see the code ?, otherwise the answer to your question can only be "apparently something is not working for you" - Vyacheslav Danshin
  • Now I will try to trim the excess. - Bogdan Shulga
  • Try writing autocomplete in the $(".dialog_create_product").on( "dialogopen", function( event, ui ) {$( ".getInputComponent" ).autocomplete({source: ['1','2','3']});} ); and not in the constructor like yours, and write down the result - Vyacheslav Danshin
  • Maybe better? $(document).on( "dialogopen", function( event, ui ) {$( ".getInputComponent" ).autocomplete({source: ['1','2','3']});} ); it still only works once. C $(".dialog_create_product").on does not work at all - Bogdan Shulga

0