Selecting radio buttons using JavaScript

More
3 years 4 months ago #105735 by LSCitizen
LSCitizen created the topic: Selecting radio buttons using JavaScript
Hello,
I am using a List (Radio) question within a survey. I would like to use the value stored in the token table to select the corect radio button. For example, if the TOKEN:ATTRIBUTE_1 == "1", then I would like for a radio button with code value of 1 to be selected.

Please Log in to join the conversation.

More
3 years 3 months ago #105744 by tpartner
tpartner replied the topic: Selecting radio buttons using JavaScript

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 3 months ago #105754 by DenisChenu
DenisChenu replied the topic: Selecting radio buttons using JavaScript
ALtrenative solution without javascript.

Use an Equation question type / hidden in the same group (just before). With: (supposing question code is QQ and ATTRIBUTE is exactly the answer code).
{QQ=if(!is_empty(QQ),QQ,TOKEN:ATTRIBUTE_1)}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
3 years 3 months ago #105769 by LSCitizen
LSCitizen replied the topic: Selecting radio buttons using JavaScript
Thanks for your help!
Both solutions work great! :)

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now