javascript - how to append values selected from autocomplete js -


what need

  • i need append values in html selected values autocomplete

code

                   $('.autocomplete_ind').autocomplete({                     lookup: industrys,                     onselect: function(suggestion)                      {                         console.log(suggestion);                          var thehtml = '<strong>industry name:</strong> ' + suggestion.name + ' selected<br> <strong>'+ suggestion.id+'</strong>';                         $('#outputcontent').append(thehtml);                         $(this ).attr( "value",  suggestion.value );                    } 

html element

 <input type="text"  autocomplete="off"  onchange="make_url();"              id="industry_name"  class="biginput autocomplete_ind"  name="allindustry"  value=""> 
  • i have tried with
  • both of solution not works .
  • i on select values autocomplete values should view view source otherwise value remain empty .
  • document.getelementsbyname('allindustry')[0].placeholder=suggestion.value;
  • $(this ).attr( "value", suggestion.value ); works append value attribute value="somevalue"
  • but on view source value="" empty shown.
  • any suggestion welcome


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -