Search code examples
javascriptautocompleteprototypejsscriptaculous

Is there a way to delete a scriptaculous autocomplete object?




I used the scriptaculous autocomplete to create a big page of editable fields, the amount of fields is dynamic, and therefore i create an array to hold all of the autocomplete objects.

then, i need to allow the user to add a field in every place of the page, so, i create a javascript function that redo the sequences of the text fields, and recreate all autocomplete's.

but there is a problem, that the old autocomplete's also appear on the page, and even if a make the array to length of zero, the old autocomplete's are hare.

Is there a way to delete completely a prototype object?


Solution

  • To delete your DOM references, you do

    bigAutoCompleteObject = null;