SPAutocomplete dropdown issue

May 8, 2012 at 10:31 PM

I have a customized SharePoint form using SPAutocomplete for several of its fields.

The problem is that the dropdown list that gets generated after the users starts typing will stay always in the first of the fields with this feature activated. So when the users type in another field that has the SPAutocomplete activated the dropdown is generated in the other field.

Does anybody know why is this happening?.

Coordinator
May 9, 2012 at 2:56 AM

I'm not sure I fully understand. Are you using SPAutocomplete on two columns? Then are the values "crossing" between them?

Looking at the way I built the function, I'm not sure how that could happen. Could you let me know what version of jQuery and SPServices you are using and also post the calls to SPAutocomplete?

M.

May 9, 2012 at 2:20 PM
Edited May 9, 2012 at 2:26 PM

Hi Marc,

I'm using jQuery 1.7.1 and SPServices 0.7.0
I have three custom lists, the only thing I changed was that I disabled attachments.

In the SharePoint form I have three fields (Manufacturer, Model and Site Name which correspond to the custom lists) and have SPAutocomplete for them, here is the code:

$().SPServices.SPAutocomplete({	
			sourceList: "Manufacturers",
			sourceColumn: "Title",
			columnName: "Manufacturer",
			ignoreCase: true,
			numChars: 3,
			slideDownSpeed: 200,
			highlightClass: "ms-bold",
			filterType: 'Contains',
			debug: false
		});
	
	//Apply autocomplete for Models list
	$().SPServices.SPAutocomplete({	
			sourceList: "ServerModels",
			sourceColumn: "Title",
			columnName: "Model",
			ignoreCase: true,
			numChars: 2,
			slideDownSpeed: 200,
			highlightClass: "ms-bold",
			filterType: 'Contains',
			debug: false
		});	
	
	//Apply autocomplete for Site Name list
	$().SPServices.SPAutocomplete({	
			sourceList: "SiteName",
			sourceColumn: "Title",
			columnName: "Site Name",
			ignoreCase: true,
			numChars: 3,
			slideDownSpeed: 200,
			highlightClass: "ms-bold",
			filterType: 'Contains',
			debug: false
		});	

When I start typing in the "Site Name" input box the Autocomplete starts working fine (I see a dropdown with the text results), then I get to the "Manufacturer" field and when I start typing the Autocomplete dropdown comes out of the "Site Name" input box, I would expected to see the dropdown in the "Manufacturer" input box, as I start typing in the last field the dropdown still remains in the "Site Name" input box.

May 9, 2012 at 7:04 PM

I solved it, strange thing but I just moved the my code to enable my fields with SPAutocomplete after the code I have for SPArrangeChoices and it worked.

Thank you.

Coordinator
May 9, 2012 at 9:16 PM

Interesting. I certainly sounds like I have a bug in there somewhere, but I'm glad you found a workaround.

M.

Coordinator
May 9, 2012 at 9:16 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Sep 11, 2012 at 7:46 PM

I found a possible (pretty easy solution)

http://spservices.codeplex.com/workitem/10067