- Posts: 63
- Karma: 3
- Thank you received: 0
Gender Default values
8 months 1 week 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
Please Log in or Create an account to join the conversation.
8 months 1 week ago #169583
by holch
I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Replied by holch on topic Gender Default values
Can you provide a sample survey (.LSS)?
I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Please Log in or Create an account to join the conversation.
8 months 1 week 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
Please Log in or Create an account to join the conversation.
8 months 1 week ago #169588
by holch
I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Please Log in or Create an account to join the conversation.
8 months 1 week ago #169589
by holch
I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
The following user(s) said Thank You: waitz
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 7791
- Karma: 618
- Thank you received: 2280
8 months 1 week 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
Please Log in or Create an account to join the conversation.