- Posts: 27
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Gender Default values
- waitz
- Topic Author
- Offline
- Junior Member
Less
More
5 years 10 months ago #169581
by waitz
Version 2.73.1+171220
Gender Default values was created by waitz
Gender is part of one of my tokens, where value 1=Female and 2=Male
I tried to add {GENDER = if(TOKEN:ATTRIBUTE_19 == '1', 'F', '')} into the gender question text field. This only added F after the question text when the attribute was 1, and nothing when the attribute is 2, but it didn't pre-tick the actual gender button. Sometimes the attribute is empty, and then gender should of course not be pre-ticked.
How can I do this?
I tried to add {GENDER = if(TOKEN:ATTRIBUTE_19 == '1', 'F', '')} into the gender question text field. This only added F after the question text when the attribute was 1, and nothing when the attribute is 2, but it didn't pre-tick the actual gender button. Sometimes the attribute is empty, and then gender should of course not be pre-ticked.
How can I do this?
Version 2.73.1+171220
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
5 years 10 months ago #169583
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 Gender Default values
Can you provide a sample survey (.LSS)?
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- waitz
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 27
- Thank you received: 0
5 years 10 months ago #169587
by waitz
Version 2.73.1+171220
Replied by waitz on topic Gender Default values
Yes, I have extracted parts of the survey. The gender question is in "More about you", and the script is no longer there.
Version 2.73.1+171220
Attachments:
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
5 years 10 months ago #169588
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 Gender Default values
For future reference: Please always upload the files unzipped. There is no need for zipping them, as they are fairly small files and it just creates additional work for those who want to help you in the forum. Make it as easy for us to help as possible.
I'll have a quick look and check if I can see something.
I'll have a quick look and check if I can see something.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
5 years 10 months ago #169589
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 Gender Default values
One other hint: clean your example survey down to only the essential requirement to test what you are trying to do. There are loads of other questions before even getting to the gender question. So for us to test it, it takes unnecessary additional time.
As it heavily depends on token tables that I don't have, I can only have a guess:
Have you tried to include this into a hidden equation type question? If included into the question text of course it will give out only a text.
As it heavily depends on token tables that I don't have, I can only have a guess:
Have you tried to include this into a hidden equation type question? If included into the question text of course it will give out only a text.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: waitz
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
5 years 10 months ago #169628
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 Gender Default values
I have already pointed out in another post that setting a question with Expression Manager MUST be done in an equation question.
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: waitz
The topic has been locked.