SPAutocomplete List Doesn't Exist Error

Aug 9, 2013 at 10:02 PM
Edited Aug 9, 2013 at 10:03 PM
First of all ... Thank you for writing this great tool.

I am trying to implement the SPAutocomplete in my custom application page in SharePoint 2013

I am using the jquery.SPServices-2013.01.js
and JQuery 1.9.0 "Non" mini version

Here is the code:
<script type="text/javascript">

        $(document).ready(function () {

            var thisSite = $().SPServices.SPGetCurrentSite();
            $(".AutoComplete").val(thisSite);

            $().SPServices.SPAutocomplete({
                sourceList: 'TestAuto',
                sourceColumn: 'EmployeeID',
                columnName: 'EmployeeID',
                filterType: 'BeginsWith',
                ignoreCase: true,
                numChars: 3,
                slideDownSpeed: 'fast'
            });
            
        });

    </script>
Here is my textbox
<div><asp:TextBox title="EmployeeID" ID="txtEmployeeID" CssClass="AutoComplete" runat="server"></asp:TextBox></div>
I am getting a 500 error.

Here is the soap envelope I captured in Fidddler
<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'><soap:Body><GetList xmlns='http://schemas.microsoft.com/sharepoint/soap/'><listName></listName></GetList></soap:Body></soap:Envelope>
If you notice the listName is empty. I am guessing that's why the 500

Have you seen this happen. Is there something I need to do.

Thank you,
Spencer
Aug 15, 2013 at 6:41 PM
SPAutoComplete only works with SharePoint list forms. For what you need to do you'll have to do a little more work. I have succesfully implemented this with jquery ui: http://jqueryui.com/autocomplete/