Demo of Autocomplete destory method in JQuery UI

Click this to run destroy method




By clicking the radio button you can execute destroy method, this will stop functionality of the autocomplete .
After destroy method no suggestion menu will appear.


source: [ "PHP", "JQuery", "JavaScript", "HTML", "ASP", "Perl", "MySQL","Access","Excel","Dot Net" ],

HTML

<input id=auto_c>

jquery

<script>
$(document).ready(function() {
////////////////
$( "#auto_c" ).autocomplete({
  source: [ "PHP", "JQuery", "JavaScript", "HTML", "ASP", "Perl", "MySQL","Access","Excel","Dot Net" ],
  minLength:0
});
///////////////
$("input:radio[name=r1]").click(function() {
	$( "#auto_c" ).autocomplete( "destroy" );
})
////////
})
</script>