Multiple choice question : Cheked true when attribute is True

More
1 month 3 weeks ago #159839 by laufla
laufla created the topic: Multiple choice question : Cheked true when attribute is True
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

Please Log in to join the conversation.

More
1 month 3 weeks ago #159845 by tpartner
tpartner replied the topic: Multiple choice question : Cheked true when attribute is True
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:

{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

Please Log in to join the conversation.

More
1 month 3 weeks ago #159869 by laufla
laufla replied the topic: Multiple choice question : Cheked true when attribute is True
Thank's a lot tpartner !

It works just as i want it to do :)

have a nice day !

Laurent

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!