- Posts: 12
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Selecting radio buttons using JavaScript
- LSCitizen
- Topic Author
- Offline
- New Member
Less
More
10 years 1 month ago #105735
by LSCitizen
Selecting radio buttons using JavaScript was created by LSCitizen
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.
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.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
10 years 1 month ago #105744
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 Selecting radio buttons using JavaScript
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13620
- Thank you received: 2488
10 years 1 month ago #105754
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on 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).
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).
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 , plugin development .
I don't answer to private message.
The topic has been locked.
- LSCitizen
- Topic Author
- Offline
- New Member
Less
More
- Posts: 12
- Thank you received: 1
10 years 1 month ago #105769
by LSCitizen
Replied by LSCitizen on topic Selecting radio buttons using JavaScript
Thanks for your help!
Both solutions work great!
Both solutions work great!
The topic has been locked.