Please help us help you and fill where relevant: Your LimeSurvey version: 5.X Own server or LimeSurvey hosting: Own Survey theme/template:
==================
One of the things I have been asked to do more and more often is to have a multiple choice question which has more than one other specify answer in it ... so I thought I would share what I have done to meet this.
First of all I used a multiple choice with comments question to enable the input boxes to be shown for each answer.
Then I removed the input boxes that were not for the other specify options with a simple script (One line per box to be removed)...
This meant that I had the desired look of the question
Now all that was left was to ensure that if they selected any of the other specify answers the survey would not continue without the corresponding text entry in that input box (without this the respondent could check the other box and move on without answering the other part)
This was done with the following script (In this instance there were 4 other specify options needed) .....
<script>
$(document).on('ready pjax:scriptcomplete',function(){
$('#ls-button-submit').bind('click', function () {
if($("#answer829445X923X417668comment").val().length < 1 && $('#answer829445X923X417668').is(':checked')) {
var moveOn = alert("You need to enter the job title in the other specify box before you can continue");
return false;
}
if($("#answer829445X923X417669comment").val().length < 1 && $('#answer829445X923X417669').is(':checked') ) {
var moveOn = alert("You need to enter the job title in the other specify box before you can continue");
return false;
}
if($("#answer829445X923X4176610comment").val().length < 1 && $('#answer829445X923X4176610').is(':checked') ) {
var moveOn = alert("You need to enter the job title in the other specify box before you can continue");
return false;
}
if($("#answer829445X923X4176611comment").val().length < 1 && $('#answer829445X923X4176611').is(':checked') ) {
var moveOn = alert("You need to enter the job title in the other specify box before you can continue");
return false;
}
});
});
</script>
I hope this helps if someone has a similar issue ....
Good call I have made the changes to do just that .... $('#answer829445X923X417661comment').css("display","none"); now reads $('#answer829445X923X417661comment').remove();