- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Using array filters or expressions when question type is drop down list
- LimeUserTest
- Topic Author
- Offline
- New Member
Less
More
5 years 2 months ago - 5 years 2 months ago #179655
by LimeUserTest
Using array filters or expressions when question type is drop down list was created by LimeUserTest
I have a survey of two questions :
Question 1: Where are you from ? (of type drop down list)
- United states
- Belgium
Question 2: How much is your salary ? (of type drop down list)
- 5000 $/€
- more than 5000 $/€
The answer options of the second questions are shown in the currency with respect to the country chosen in question 1. Since I don't want to create many conditional questions with different currencies (current solution). I am trying to find a way to change them by using an expression.
Another solution was to use this expression in the answer options 5000 {if ( Q1=='A1' , '$' ,'€')} as in the attached file.
This solution would work if the type of question is Multiple choice but would not work for the drop down list unfortunately cause apparently this is a bug in Lime Survey.
Is there any other expression to try ? Or a Java script code to do that ?
Question 1: Where are you from ? (of type drop down list)
- United states
- Belgium
Question 2: How much is your salary ? (of type drop down list)
- 5000 $/€
- more than 5000 $/€
The answer options of the second questions are shown in the currency with respect to the country chosen in question 1. Since I don't want to create many conditional questions with different currencies (current solution). I am trying to find a way to change them by using an expression.
Another solution was to use this expression in the answer options 5000 {if ( Q1=='A1' , '$' ,'€')} as in the attached file.
This solution would work if the type of question is Multiple choice but would not work for the drop down list unfortunately cause apparently this is a bug in Lime Survey.
Is there any other expression to try ? Or a Java script code to do that ?
Attachments:
Last edit: 5 years 2 months ago by LimeUserTest.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13624
- Thank you received: 2490
5 years 2 months ago #179660
by DenisChenu
You can use Radio list if it's same page.
In another page : it's OK if you are in 3.15.5 (or 6).
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Using array filters or expressions when question type is drop down list
Not a bug, since we can not update drop down via javascript in same way : Expression in fdropdown use static variable .LimeUserTest wrote: If the type of question is Multiple choice but would not work for the drop down list unfortunately cause apparently this is a bug in Lime Survey.
Is there any other expression to try ? Or a Java script code to do that ?
You can use Radio list if it's same page.
In another page : it's OK if you are in 3.15.5 (or 6).
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: LimeUserTest
The topic has been locked.
- LimeUserTest
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
5 years 2 months ago #179665
by LimeUserTest
Replied by LimeUserTest on topic Using array filters or expressions when question type is drop down list
Thank you !
But in my case I need to use the drop down type. I don't want to go throw a radio list cause this is a requirement. I understand from your reply that there is no way to do it with the drop down list even in Java Script ?
Thanks again
But in my case I need to use the drop down type. I don't want to go throw a radio list cause this is a requirement. I understand from your reply that there is no way to do it with the drop down list even in Java Script ?
Thanks again
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13624
- Thank you received: 2490
5 years 2 months ago #179672
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Using array filters or expressions when question type is drop down list
Yes, you can use a dropdow and update value with JS, but it's REALLY more hard …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3970
5 years 2 months ago #179772
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Using array filters or expressions when question type is drop down list
Hi,
here you get an example.
Well, base language is italian, but this only affects the buttons, etc.
[hr]
Best regards
Joffm
here you get an example.
Well, base language is italian, but this only affects the buttons, etc.
[hr]
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, LimeUserTest
The topic has been locked.
- LimeUserTest
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
5 years 2 months ago #179846
by LimeUserTest
Replied by LimeUserTest on topic Using array filters or expressions when question type is drop down list
Hi Joffm,
that makes sense and is working thank you. But I am wondering why isn't it working in case the question number 1 and number 2 are in the same group ?!
that makes sense and is working thank you. But I am wondering why isn't it working in case the question number 1 and number 2 are in the same group ?!
The topic has been locked.
- holch
- Away
- LimeSurvey Community Team
Less
More
- Posts: 11644
- Thank you received: 2738
5 years 2 months ago - 5 years 2 months ago #179850
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Using array filters or expressions when question type is drop down list
This has nothing to do with this thread. Please ask this in your own thread.Hi I am using free plan of Lime survey which shows that 25 responses can be recorded per month. I have calculated my survey participants and it makes 28 responses , so can I still use this free plan or I have to buy the basic plan?
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Last edit: 5 years 2 months ago by holch.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
5 years 2 months ago #179852
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Using array filters or expressions when question type is drop down list
Or ask LimeSurvey Support -
www.limesurvey.org/customer-support/contact-us
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3970
5 years 2 months ago #179855
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Using array filters or expressions when question type is drop down list
Hi,
If you say "question by question" it can be in the same group.
The important thing is that the two questions are NOT on the same screen.
Best regards
Joffm
Because I ran it "group by group".But I am wondering why isn't it working in case the question number 1 and number 2 are in the same group ?!
If you say "question by question" it can be in the same group.
The important thing is that the two questions are NOT on the same screen.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- LimeUserTest
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
5 years 2 months ago #179863
by LimeUserTest
Replied by LimeUserTest on topic Using array filters or expressions when question type is drop down list
Yes, but unfortunately I need them to be on the same screen and that's the point!!
The topic has been locked.