- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Autocomplete not working
- mcole
- Topic Author
- Offline
- New Member
Less
More
6 years 4 months ago - 6 years 4 months ago #160764
by mcole
Autocomplete not working was created by mcole
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.
and in the source area of the question I added
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
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.
Code:
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
Code:
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: 6 years 4 months ago by mcole.
The topic has been locked.
- ollehar
- Offline
- LimeSurvey GmbH Employee
Less
More
- Posts: 522
- Thank you received: 108
6 years 4 months ago #160769
by ollehar
Replied by ollehar on topic Autocomplete not working
Click F12 and check the JS console. There's a syntax error:
$(document).ready(function());
No function body.
$(document).ready(function());
No function body.
The following user(s) said Thank You: mcole
The topic has been locked.
- mcole
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
6 years 4 months ago #160787
by mcole
Replied by mcole on 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!!!!!
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
doAutocomplete()
});
</script>
I sure appreciate it!!!!!
The topic has been locked.