Autocomplete not working

More
3 weeks 3 days ago - 3 weeks 3 days ago #160764 by mcole
mcole created the topic: Autocomplete not working
I have a survey that I use twice a year. One survey I used autocomplete and it worked perfectly. I just added the simple script in the source area.

In the second survey I have almost 10,000 names in the autocomplete and it's too big for the source area.

So, I added the list to the /template.js file.
var doAutocomplete = function() {
    var qID = 8;
    $('#question'+qID+' input[type="text"]').autocomplete({
	minLength: 2, // This line is optional, signifies number of keystrokes before autocomplete is initiated
	source: dentistNames
    });
 };
 
var dentistNames = [
"My","giant","list","of","names"
];

and in the source area of the question I added
Choose your Top Dentists - Select up to three (3) per specialty
<script type="text/javascript" charset="utf-8">
 $(document).ready(function(){doAutocomplete()});
</script>

And for some reason I cannot get it to work.

Can anyone see what I might have missed? Here is a link to an exact replica of the question:

phoenixmag.limequery.com/371455?newtest=Y&lang=en

Thank you for looking.

-Matt
Last Edit: 3 weeks 3 days ago by mcole.

Please Log in to join the conversation.

More
3 weeks 3 days ago #160769 by olle
olle replied the topic: Autocomplete not working
Click F12 and check the JS console. There's a syntax error:

$(document).ready(function());

No function body.
The following user(s) said Thank You: mcole

Please Log in to join the conversation.

More
3 weeks 2 days ago #160787 by mcole
mcole replied the topic: Autocomplete not working
Thank you. That did it. A couple of returns and I'm ready to rock!

<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
doAutocomplete()
});
</script>

I sure appreciate it!!!!!

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!