Welcome to the LimeSurvey Community Forum

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

Multiple choice question : Cheked true when attribute is True

  • laufla
  • laufla's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 4 months ago #159839 by laufla
Hi,

I'm using a multiple choice question (5 choices) without other choice.
I have 5 attributes in my survey participant record.

attributes value are 1 or null (1 true, null false)

So, i tried to do add javascript to activate the box (or not)...

as it's not working, i tried this script :



<script LANGUAGE="JavaScript">
{
$("input#answer{SGQ}SQ001").attr('checked', true);
}
</SCRIPT>


it does not work too...

any clue how to do this ?

Thank's
Laurent
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 4 months ago #159845 by tpartner
You should be able to do that with Expression Manager. Place an equation type question after the multi-choice with something like this in it:

Code:
{Q1_SQ001 = if(TOKEN:ATTRIBUTE_1 == '1', 'Y', '')}

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, laufla
The topic has been locked.
  • laufla
  • laufla's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 4 months ago #159869 by laufla
Thank's a lot tpartner !

It works just as i want it to do :)

have a nice day !

Laurent
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose