Autocompleting when a certain class is present
I'm proposing to reduce code by putting all similar code to one function:

function initAutocomplete(selector, field) {
  $(selector).on('keydown', function() { 
    $(this).autocomplete({
      source: '&lt;?php echo base_url();?&gt;description/get_description',
      minLength: 1,
      select: function(evt, ui) {
        this.form.elements[field].value = ui.item.sub_description;
      }
    });
  });
}

initAutocomplete('.sn', 'sub_description');
initAutocomplete('.sn2', 'sub_description2');