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

THEMA: Autcomplete error "Uncaught typeError"

Autcomplete error "Uncaught typeError" 11 Monate 2 Wochen her #109821

Hi!

I've been using the autocomplete for quite a while already but for some reason it has stopped working. I went to the limesurvey workarounds manual and updated the script I was using but still get the following error:

fullArray = $.csv.toArrays(data);
Uncaught TypeError: Cannot read property 'toArrays' of undefined.


Thanks for your help!!


The whole code I am using is the following:


<script type="text/javascript" charset="utf-8">

$(document).ready(function() {

// Define the CSV filename
var csvName = 'fsa.csv';

// Define some paths
var surveyRoot = location.pathname.split('index.php')[0];
// var templateName = $('head link[href*="template.css"]').attr('href').replace(/\/template.css/, '').split('/templates/')[1];
var csvPath = surveyRoot+'autocomplete/';

// Define the questions
var q1ID = '{QID}';
var q1 = $('#question'+q1ID);
// var q2 = $(q1).nextAll('.text-short:eq(0)');
// var q3 = $(q1).nextAll('.text-short:eq(1)');

// Define the path to the CSV
var url = csvPath+csvName;

// Create an array to hold the CSV rows
var namesArr = new Array();

// Grab the CSV contents
$.get( url, function( data ){

// Convert CSV contents to an array of arrays
fullArray = $.csv.toArrays(data);
// Load the CSV rows array
$(fullArray).each(function(i, item){
namesArr.push(item[0]);
});

// Initialise the autocomplete plugin
$('input.text', q1).autocomplete({
source: namesArr,
});
});
});
</script>
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Autcomplete error "Uncaught typeError" 11 Monate 1 Woche her #109862

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4843
  • Dank erhalten: 987
  • Karma: 417
It doesn't look like the CSV contents are being imported correctly.

What changes were made to the installation before the error appeared?


.
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.

Autcomplete error "Uncaught typeError" 11 Monate 1 Woche her #109894

Hi Tony,
Thanks for your response.

I just updated limesurvey. I also changed the survey template. But I moved everything as it should be. And I don't get an error of not finding the csv.

I'll provide a link to a test question later today for you to look at.

Thanks!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Autcomplete error "Uncaught typeError" 11 Monate 1 Woche her #109896

Der Administrator hat öffentliche Schreibrechte deaktiviert.

Autcomplete error "Uncaught typeError" 11 Monate 1 Woche her #109905

And this is the link of the file....

gbresearch.net/research/autocomplete/fsa.csv
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Autcomplete error "Uncaught typeError" 11 Monate 1 Woche her #109924

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4843
  • Dank erhalten: 987
  • Karma: 417
A couple of things to check...

1) This line should have a lower-case v in "Var"
Var url = "research/autocomplete/fsa.csv";

2) Because you are using a subdomain, the URL defined in that line leads to research.gbresearch.net/research/autocomplete/fsa.csv which doesn't exist. I think the defined URL should simply be "autocomplete/fsa.csv".


.
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: 11 Monate 1 Woche her von tpartner.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Autcomplete error "Uncaught typeError" 11 Monate 1 Woche her #109943

I changed it as suggested but still not working.

Any more suggestions?

I would think it stopped working when we changed the limesurvey from gbresearch.net/research to research.gbresearch.net

Do you think it could be the problem? Yet, it seems it finds the file correctly.
Letzte Änderung: 11 Monate 1 Woche her von jorge_acevedo.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Autcomplete error "Uncaught typeError" 11 Monate 1 Woche her #109959

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4843
  • Dank erhalten: 987
  • Karma: 417
Try using an absolute path to the CSV.
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.

Autcomplete error "Uncaught typeError" 11 Monate 1 Woche her #109973

Pardon my ignorance. But how do I do that?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Autcomplete error "Uncaught typeError" 11 Monate 1 Woche her #109992

Tony,

Just wanted to let you know that I was able to fix it.

What I did:

I was using the jquery.csv.js version .5 that is posted on the limesurvey wiki
code.google.com/p/jquery-csv/source/brow...77f1d747bc860b943fe7

Apparently that's an old code.

I found in google a new version 0.71

code.google.com/p/jquery-csv/downloads/d...csv-0.71.js&can=2&q=

I replaced the old version for the new one and my autocomplete started working!!!


Thanks for your support.
Letzte Änderung: 11 Monate 1 Woche her von jorge_acevedo. Begründung: changed mispelling
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
  • 2
Moderatoren: ITEd
Ladezeit der Seite: 0.153 Sekunden
Donation Image