breaking head over jquery autocomplete function

breaking head over jquery autocomplete function

p>Hi i'm tryin gto achieve the following with different autocomplete form fields from different asp/sql json results.

For one of the functions i had to add extra function, but because of this the functions below it are no longer executed. Could someone pleas help me on my way. I've tried a lot of different approached but the lead me further away from my goal.

here is part of the code:

  1. $(function() {
    $( "#searchword" ).autocomplete({
    source: "sourcename.asp",
    minLength: 1
    }).data("autocomplete")._renderItem = function( ul, item ) {
    var re = item.id
    if (re.indexOf(" | notactive") != -1){
    template = ""<span style=' text-decoration:line-through'>" + re.replace(" | notactive", "") +" </span>&nbspdeactivated"
    } else {
    template = re };
    return $( "<li></li>")
  2. .data( "item.autocomplete", item )
  3. .append( " " + item.id.replace(re,template) + " " )
  4. .appendTo( ul );
  5. };
  6. });
  7. $(function() {
  8. $( "#matnewz" ).autocomplete({
  9. source: "sourcematnew.asp",
  10. minLength: 1
  11. });
  12. });   
  13. $(function() {
  14. $( "#matnewzvs" ).autocomplete({
  15. source: "sourcematnewvs.asp",
  16. minLength: 1
  17. });
  18. });
  19. $(function() {
  20. $( "#matnewzbs" ).autocomplete({
  21. source: "sourcematnewbs.asp",
  22. minLength: 1
  23. });
  24. });

 the first function works fine, the other functions don't work anymore. If I revert to the orginal code everything works fine - but i wanted to add the extra options in the first section.

  1. $(function() {
    $( "#searchword" ).autocomplete({
    source: "sourcename.asp",
    minLength: 1
    });
    });

Yes I know that i need to update to the new jquery version for uiAutocomplete, but this is imossible at the moment due to differnt OS and older computers at the moment where this code is used.

Does anyone have any idea how to approach this?