Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Question with autofill function gets cut off when saving

More
6 years 5 months ago - 6 years 5 months ago #160466 by mcole
I created a question that has a simple piece of code in to autofill while a user is typing an answer.
Code:
Choose your Top Doctors - Select up to three (3) per specialty<script type="text/javascript" charset="utf-8">
 
    $(document).ready(function() {
 
    var qID = 168;
 
    $('#question'+qID+' input[type="text"]').autocomplete({
      minLength: 2, // This line is optional, signifies number of keystrokes before autocomplete is initiated
      source: [
"a doctor","b doctor","c doctor","etc"
]
    });
 
  });
 
</script>
 

When I go to save the question it gets cut off right in the middle of the code.

Now to be clear - there are around 10,000 names in that list. I read somewhere the question cannot be too long, so I am thinking there is an expression manager problem, but how do I find a problem in a csv that is 10,000 columns?

Any ideas would be greatly appreciated.

I am attaching a text file with the question in it, in case you want to see the whole thing

Thank you
Last edit: 6 years 5 months ago by mcole. Reason: simple edit to make the question easier to read
The topic has been locked.
More
6 years 5 months ago #160788 by mcole
So anyone looking for autofill with a large list here is how to do it:

The easiest way would be to take the default template and create a copy of it.

Then put the list of doctors into the template js file.

There you may register a global variable and call it as the source for your survey.

A link to how I did it!

www.limesurvey.org/forum/installation-a-...e-not-working#160769
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 5 months ago #160790 by Joffm
Hi, mcole,
thank you for sharing your ideas and solutions.

But in the manual there are several ways to do this.

read the options from a fixed array
read them from a csv-file
read them from a MySql database.
manual.limesurvey.org/Workarounds:_Manip...r_LimeSurvey_2.05.2B

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose