- Posts: 3
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Set default answers in Array (flexible) specific per subquestion
- Sofieke
- Topic Author
- Offline
- New Member
Less
More
6 years 9 months ago #156034
by Sofieke
Set default answers in Array (flexible) specific per subquestion was created by Sofieke
I am new in Lime survey and I am looking for a solution to set default answers in an Array.
I have to specify for each row a specific default answer.
I use the following, and it works, but it puts for each row (each subquestion) the same answer.
<script type="text/javascript">
$(document).ready(function() {
$('input[type=radio][id$=' + 3 + ']',
$('#question102573')).each (function () {
$(this).attr('checked', true);
});
});
</script>
I would like to specify a specific default answer for each specific subquestion.
I tried it with the following code (among others), but it is not working:
<script type="text/javascript">
$(document).ready(function() {
$('#answer916993X1185X102573SQ004-A2'). (function (){
$(this).attr('chekcked', true);
});
});
</script>
Some help would be much appreciated...
I have to specify for each row a specific default answer.
I use the following, and it works, but it puts for each row (each subquestion) the same answer.
<script type="text/javascript">
$(document).ready(function() {
$('input[type=radio][id$=' + 3 + ']',
$('#question102573')).each (function () {
$(this).attr('checked', true);
});
});
</script>
I would like to specify a specific default answer for each specific subquestion.
I tried it with the following code (among others), but it is not working:
<script type="text/javascript">
$(document).ready(function() {
$('#answer916993X1185X102573SQ004-A2'). (function (){
$(this).attr('chekcked', true);
});
});
</script>
Some help would be much appreciated...
The topic has been locked.
- Sofieke
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
6 years 9 months ago #156036
by Sofieke
Replied by Sofieke on topic Set default answers in Array (flexible) specific per subquestion
I use Version 2.62.0 build 170124
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
6 years 9 months ago #156040
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 Set default answers in Array (flexible) specific per subquestion
For such system (default answer on 'any question type), i prefer to use an Equation question type at start of survey.
For example, here : if the questio code are ARRAY
Really more easy and speediest
For example, here : if the questio code are ARRAY
Code:
{ARRAY_SQ004=if(is_empty(ARRAY_SQ004),"A2",ARRAY_SQ004)}
Really more easy and speediest
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.
- Sofieke
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
6 years 9 months ago #156065
by Sofieke
Replied by Sofieke on topic Set default answers in Array (flexible) specific per subquestion
Thanks a lot! That was very helpful and it works perfectly!
The topic has been locked.