Problem with Array by column filter

More
3 years 5 months ago - 3 years 5 months ago #108206 by Soeren
Soeren created the topic: Problem with Array by column filter
Hello
I tried to do this: manual.limesurvey.org/Workarounds:_Manip...2Multiple-Options.22
But it didn´t work out.
Like in the discribition I placed the functions in my template.js file:




Then I placed the script in the source of one of the questions:



But it didn`t work. Can somebody help me. Where is the mistake I made?
best
Soerioes
Attachments:
Last Edit: 3 years 5 months ago by Soeren.

Please Log in to join the conversation.

More
3 years 5 months ago - 3 years 5 months ago #108207 by urbana
urbana replied the topic: Problem with Array by column filter
did you insert the question text after placing the javascript?
then you replaced the script with your question text

i place my javascript in the help text

You can check the following things (use chrome for that):
1. Start the question and check the javascript console for errors
2. Right Mouse click on the question -> Inspect Element -> search for your script in the source code is it there? if not perhaps you overwrited it

Further: I noticed that you start the function with two var's - but the function ist defined with three var's, qMultiopt, qArray, prevPage
Perhaps that causes an error
-> forget that :)

But again check the console
Last Edit: 3 years 5 months ago by urbana.

Please Log in to join the conversation.

More
3 years 5 months ago #108209 by Soeren
Soeren replied the topic: Problem with Array by column filter
I placed the source in the help text. But it is still not working.
I checked the console and this is what it looks like:

I think that the function is there. But I am not sure.
Attachments:

Please Log in to join the conversation.

More
3 years 5 months ago #108210 by urbana
urbana replied the topic: Problem with Array by column filter
Yes the function is there but check the console are there any errors?

Please Log in to join the conversation.

More
3 years 5 months ago #108211 by Soeren
Soeren replied the topic: Problem with Array by column filter
And i got this Error. But I don´t know what that means
Attachments:

Please Log in to join the conversation.

More
3 years 5 months ago - 3 years 5 months ago #108212 by urbana
urbana replied the topic: Problem with Array by column filter
I'm sorry I didn't recognized it
You have to call the function like that:
filterArrbyCol("QuesitinID")

You have to use Quotes!! Without quotes JavaScript searchs for variables with that namea but of course they doens't exists

Sorry for the spelling but i m writing from my phone with german layout
Last Edit: 3 years 5 months ago by urbana.

Please Log in to join the conversation.

More
3 years 5 months ago #108213 by Soeren
Soeren replied the topic: Problem with Array by column filter
Sorry. But it is still not working.
The console shows the following mistake:

Attachments:

Please Log in to join the conversation.

More
3 years 5 months ago - 3 years 5 months ago #108216 by urbana
urbana replied the topic: Problem with Array by column filter
Good morning yes but now we know the calling is Correct but the systems tells you the function you call doesn't exists.

Are you sure the function is in your template.JS
Are you sure the survey has the design with the template including the function

You can try to put the Function before the call in the helptext
Last Edit: 3 years 5 months ago by urbana.

Please Log in to join the conversation.

More
3 years 5 months ago #108236 by Soeren
Soeren replied the topic: Problem with Array by column filter
When I place the skript in the helptext. It just shows the text itself.

Attachments:

Please Log in to join the conversation.

More
3 years 5 months ago #108237 by Soeren
Soeren replied the topic: Problem with Array by column filter
Is it possible that I have only version 2.00?
Because I just realised this:

Attachments:

Please Log in to join the conversation.

More
3 years 5 months ago #108239 by urbana
urbana replied the topic: Problem with Array by column filter
Yes you have Version 2.0 but that isn't the problem.
Of course you have to place the script in HTML Mode

So click in the helptext and then click on Quellcode (Sourcecode)
And then paste it there

Please Log in to join the conversation.

More
3 years 5 months ago #108240 by Soeren
Soeren replied the topic: Problem with Array by column filter
That is what I did. Do I have to put a tag before the code?

Please Log in to join the conversation.

More
3 years 5 months ago #108241 by urbana
urbana replied the topic: Problem with Array by column filter
of course you have to place the code between

<script type="text/javascript">

</script>

Please Log in to join the conversation.

More
3 years 5 months ago #108249 by tpartner
tpartner replied the topic: Problem with Array by column filter
The script in the question source should use ONLY the question IDs, NOT the question SGQAs.

<script type="text/javascript" charset="utf-8">
        $(document).ready(function() {
                filterArrByCol(10997, 11001);
        });
</script>


.

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

Please Log in to join the conversation.

More
3 years 5 months ago #108257 by Soeren
Soeren replied the topic: Problem with Array by column filter
Sorry. I corrected it. But then I had this Error:





I tried it with different templates.
Attachments:

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now