Question with autofill function gets cut off when saving

More
1 month 5 days ago - 1 month 5 days ago #160466 by mcole
mcole created the topic: Question with autofill function gets cut off when saving
I created a question that has a simple piece of code in to autofill while a user is typing an answer.
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
Attachments:
Last Edit: 1 month 5 days ago by mcole. Reason: simple edit to make the question easier to read

Please Log in to join the conversation.

More
4 weeks 5 hours ago #160788 by mcole
mcole replied the topic: Question with autofill function gets cut off when saving
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

Please Log in to join the conversation.

More
4 weeks 25 minutes ago #160790 by Joffm
Joffm replied the topic: Question with autofill function gets cut off when saving
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.
https://manual.limesurvey.org/Workarounds:_Manipulating_a_survey_at_runtime_using_Javascript#Update_for_LimeSurvey_2.05.2B

Best regards
Joffm

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!