Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Gender Default values

  • waitz
  • waitz's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 10 months ago #169581 by waitz
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?

Version 2.73.1+171220
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #169583 by holch
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
  • waitz's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 10 months ago #169587 by waitz
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.

File Attachment:

File Name: surveys_archive.zip
File Size:7 KB

Version 2.73.1+171220
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #169588 by holch
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 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
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #169589 by holch
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.

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
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #169628 by tpartner
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.

Lime-years ahead

Online-surveys for every purse and purpose