Check out the LimeSurvey source code on GitHub!

Autocomplete a question from csv and fill two more question from same CSV

More
3 years 7 months ago #97147 by xsiyez
Please find attached the test survey with other relevant files attached. Kindly change the csv url in the javascript attached to question 1_0 source.
Attachments:

Please Log in to join the conversation.

More
3 years 7 months ago - 3 years 7 months ago #97160 by tpartner
Ah, I get it now.

You are using a new version of jquery.csv.js, so this:
fullArray = jQuery.csv()(data);
Needs to be changed to this:
fullArray = $.csv.toArrays(data);


Here is an updated version of your survey with the following changes:
- The script is now in the source of 1_2
- Added a snippet to automatically detect the questions and their text inputs (questions must be sequential)
- The script automatically looks for the CSV file in the template directory

Attachment limesurvey_survey_6928591.lss not found


And here is a template with your CSV file and jquery.csv.js in it.

Attachment test_csv.zip not found


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last Edit: 3 years 7 months ago by tpartner.

Please Log in to join the conversation.

More
3 years 7 months ago #97167 by xsiyez
Thanks a lot Tony!
It has worked. And thanks for the other hints you included in the js file!

Alex

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form