+2  A: 

I'm kinda guessing here, I don't really know asp.net so correct me if I am wrong.

I'm assuming that multiview is doing some sort of ajaxy type thing in the background of asp.net in which case when your search form is reloaded the jQuery.autocomplete would not apply to the new form.

More than likely I'm completely wrong in what I just said though.


Edit for my second comment.

$('.autocomplete').each(function(i,element){
    $(element).autocomplete({...});
    $(element).result(function(event, data, formatted) { 
        // Now based on you're element id you can build up an id and work with that
        var id = element.id + '-extra-stuff';               
        var str = data.toString().split("|", 2);
        $('#' + id).val(str[1]);
    });
});
Nalum
You are correct, Postback messes with the jQuery. Looking into it i found information about using pageLoad() (see above code) which was working great when i only had one instance of the searchBox on the page.
TheDPQ
You seem to be accessing the form element by ID, if each instance of the search box has the same ID the JavaScript will fail because the ID should be unique.What if you change your code so that it is getting the input field by a class, that will allow for multiple auto-complete fields.e.g. `$(".autocomplete").autocomplete(EmployeeList`
Nalum
I did originally just use a cssclass when I was first testing this out. However there are pitfalls trying to split up name strings and assuming where their first/last name stop and start. First names like 'Mary Ann' or last names like 'Dela Cruz' would futz that all up. So i updated it with a hidden field with no need for a wonky way of searching again to get the ID. However the ASP:HIDDEN FIELD doesn't support a cssclass attribute, so I don't have a way of populating the EmployeeID hidden field once they have selected the employee from autocomplete.
TheDPQ
If you use the class and then use `.each` you would be able to work with each instance of the search box. I've put an example in my original answer.
Nalum
Thank you SO much, this is exactly what i was looking for. I updated my original question with the code i finally used. Let me know what you think.
TheDPQ
Looks good TheDPQ, glad I could help you.
Nalum