Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1
  • 2

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

Re: Autocomplete a question from csv and fill two more question from same CSV 1 Jahr 1 Monat her #97056

  • xsiyez
  • xsiyezs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 18
  • Karma: 0
Hi

I managed to resolve the first one because I loaded jquery.csv.js before jquery. However, am still not able to this work.
TypeError: jQuery.csv is not a function
fullArray = jQuery.csv()(data);

Still persists in Firebug. Please help.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Autocomplete a question from csv and fill two more question from same CSV 1 Jahr 1 Monat her #97101

  • xsiyez
  • xsiyezs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 18
  • Karma: 0
Anyone please?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Autocomplete a question from csv and fill two more question from same CSV 1 Jahr 1 Monat her #97120

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4049
  • Dank erhalten: 739
  • Karma: 341
Well, I see a few possible problems.

1) This:
var qCompanyName = answer86545X17X536;
Should be
var qCompanyName = $('#answer86545X17X536');


2) This:
var qCompanyId = answer86545X17X538
Should be
var qCompanyId = $('#answer86545X17X538');


3) Does http://bozpcf/templates/default/php/companies.csv actually exist?


4) It looks like the attached CSV file has the company IDs in the first column and the names in the second but your script indicates that you want them the other way around. The autocomplete function will look at the first column and qCompanyId will be populated from the second column.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Letzte Änderung: 1 Jahr 1 Monat her von tpartner.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Autocomplete a question from csv and fill two more question from same CSV 1 Jahr 1 Monat her #97139

  • xsiyez
  • xsiyezs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 18
  • Karma: 0
Hi Tony

Thanks for the response. I have modified the variables as suggested and swapped the column names in the csv.... :). The csv actually exists as I can browse to in the browser and can see its output in firebug console when I load the csv url.

However, the error:
TypeError: jQuery.csv is not a function
fullArray = jQuery.csv()(data);
Still appears in firebug. I see the complaint in firebug is on
jQuery.csv()
.I only included
jquery.csv.js
from here in startpage.pstpl. Do I need to include any other javascript plugin apart from the
jquery.csv.js
plugin and the javascript that I included in the question group?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Autocomplete a question from csv and fill two more question from same CSV 1 Jahr 1 Monat her #97140

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4049
  • Dank erhalten: 739
  • Karma: 341
Can you activate a test survey?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Autocomplete a question from csv and fill two more question from same CSV 1 Jahr 1 Monat her #97147

  • xsiyez
  • xsiyezs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 18
  • Karma: 0
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Autocomplete a question from csv and fill two more question from same CSV 1 Jahr 1 Monat her #97160

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4049
  • Dank erhalten: 739
  • Karma: 341
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

Anhang limesurvey_survey_6928591.lss nicht gefunden


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

Anhang test_csv.zip nicht gefunden

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Letzte Änderung: 1 Jahr 1 Monat her von tpartner.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Autocomplete a question from csv and fill two more question from same CSV 1 Jahr 1 Monat her #97167

  • xsiyez
  • xsiyezs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 18
  • Karma: 0
Thanks a lot Tony!
It has worked. And thanks for the other hints you included in the js file!

Alex
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
  • 2
Moderatoren: ITEd
Ladezeit der Seite: 0.395 Sekunden
Donation Image