- Posts: 3
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Can put some value to text-style question by click radio button?
- cnsla
- Topic Author
- Offline
- New Member
Less
More
9 years 2 months ago #116370
by cnsla
Can put some value to text-style question by click radio button? was created by cnsla
Can put some value to text-style question by click radio button?
Like below.
I tried it, but didn't work.
<input type="radio" class="text empty" id="answer{SGQ}SQ001" name="{SGQ}SQ001" value="1" />
Like below.
I tried it, but didn't work.
<input type="radio" class="text empty" id="answer{SGQ}SQ001" name="{SGQ}SQ001" value="1" />
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
9 years 2 months ago #116384
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 Can put some value to text-style question by click radio button?
Sorry, don't understand the 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: cnsla
The topic has been locked.
- cnsla
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
9 years 2 months ago #116388
by cnsla
Replied by cnsla on topic Can put some value to text-style question by click radio button?
Due to huge survey size, I gave up using 'array'. (php error happens...)
I hope to make some workaround in "multiple short texts" question type.
I want to make some radio buttons 'linked' to text input box
(i.e. when clink radio button 1, put "1" to SQ 001 text input box, when click radio button 2, erase "1" and put "2" to SQ001 text input box)
I hope to make some workaround in "multiple short texts" question type.
I want to make some radio buttons 'linked' to text input box
(i.e. when clink radio button 1, put "1" to SQ 001 text input box, when click radio button 2, erase "1" and put "2" to SQ001 text input box)
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
9 years 2 months ago #116432
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 Can put some value to text-style question by click radio button?
Placing something like this in the source of the multiple-text question should load the first two inputs. Of course, you will need to replace "input.my-radio-class" and "input.another-radio-class" with the proper selectors.
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify this question var thisQuestion = $('#question{QID}'); // Load first text input $('input.my-radio-class').click(function(e) { $('input.text:eq(0)', thisQuestion).val($(this).attr('value')); }); // Load second text input $('input.another-radio-class').click(function(e) { $('input.text:eq(2)', thisQuestion).val($(this).attr('value')); }); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.