- Posts: 164
- Thank you received: 5
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
array text value based dropdown list
- brais24
- Topic Author
- Offline
- Elite Member
Less
More
3 years 8 months ago #203348
by brais24
array text value based dropdown list was created by brais24
Hi people, Im new here.
I have a doubt with Limesurvey, i have a dropdown list question called P1 that have for example 3 options, "A1","A2" and "A3", and the next question is an array text value called P2 that accepts numbers only, I want that, if you select A1, for example, on the array text, in total, you just be able to put as maximum 1, wich is the value of the dropdown list.
Is there any way to do it? Ive search by the forums and dont find nothing related to this.
I try with this on equation validation question, but dont work if(P1 == "A1",sum(self.NAOK) == 1,sum(self.NAOK) == 2)
On this example I try to do, if P1 is = to A1, the maximum value gonna be 1, else, gonna be 2, but dont works.
Thanks for the help.
I have a doubt with Limesurvey, i have a dropdown list question called P1 that have for example 3 options, "A1","A2" and "A3", and the next question is an array text value called P2 that accepts numbers only, I want that, if you select A1, for example, on the array text, in total, you just be able to put as maximum 1, wich is the value of the dropdown list.
Is there any way to do it? Ive search by the forums and dont find nothing related to this.
I try with this on equation validation question, but dont work if(P1 == "A1",sum(self.NAOK) == 1,sum(self.NAOK) == 2)
On this example I try to do, if P1 is = to A1, the maximum value gonna be 1, else, gonna be 2, but dont works.
Thanks for the help.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
3 years 8 months ago #203349
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic array text value based dropdown list
Hi,
though you did not mention the version you are using nor show us exactly where you entered the validation equation,
here is what you get when you enter your (correct) equation correctly.
Joffm
though you did not mention the version you are using nor show us exactly where you entered the validation equation,
here is what you get when you enter your (correct) equation correctly.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- brais24
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 164
- Thank you received: 5
3 years 8 months ago #203350
by brais24
Replied by brais24 on topic array text value based dropdown list
Ok, thank you, that works, my version is a little bit old 2.72
Now, in the same case, the P1 is the number of workers , and the 3 options is
A1 = between 1 and 2
A2 = between 10 and 20
A3 = between 30 and 50
How can I do this? I try with multiple if, but dont work.
Thanks for the help, really.
Now, in the same case, the P1 is the number of workers , and the 3 options is
A1 = between 1 and 2
A2 = between 10 and 20
A3 = between 30 and 50
How can I do this? I try with multiple if, but dont work.
Thanks for the help, really.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
3 years 8 months ago #203351
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic array text value based dropdown list
The same, you only have to compare that the "sum is greater than x AND sum is smaller than y".
Joffm
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- brais24
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 164
- Thank you received: 5
3 years 8 months ago #203352
by brais24
Replied by brais24 on topic array text value based dropdown list
But here we need to put a minimal and a maximum number for the same option if i dont missunderstand
The topic has been locked.
- brais24
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 164
- Thank you received: 5
3 years 8 months ago #203353
by brais24
Replied by brais24 on topic array text value based dropdown list
Somethink like this?
if(P1 == "A1",sum(self.NAOK) <= 1,if(P1 == "A1",sum(self.NAOK) <= 2))
if(P1 == "A1",sum(self.NAOK) <= 1,if(P1 == "A1",sum(self.NAOK) <= 2))
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
3 years 8 months ago #203354
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic array text value based dropdown list
Just translate my phrase.
You saw the capitalized AND?
Of course you may use "greater and equal", "smaller and equal" as well.
Joffm
You saw the capitalized AND?
Of course you may use "greater and equal", "smaller and equal" as well.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- brais24
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 164
- Thank you received: 5
3 years 8 months ago #203356
by brais24
Replied by brais24 on topic array text value based dropdown list
Ooook, thanks a lot, that work.
Sorry, I didnt see the capitalize AND, ha ha.
Thanks for the help, now its time to make the complete code.
Sorry, I didnt see the capitalize AND, ha ha.
Thanks for the help, now its time to make the complete code.
The topic has been locked.