filling in a radio button if a multiple choice response is selected

More
3 years 8 months ago - 3 years 8 months ago #97511 by bwoo5
I have version 1.91 so before EM, so this is through javascript until I can get around to updating.

Q2 is multiple choice.
Q3 is a yes/no radio button.

I need to have the radio button be check yes if option 4 it ticked in the multiple choice and no if it isn't.

Also need for the radio button to be hidden but make sure it fires for quota purposes when they click next.
Last Edit: 3 years 8 months ago by bwoo5.

Please Log in to join the conversation.

More
3 years 8 months ago #97516 by DenisChenu
Set Q3 to hidden
Add Q4 : equation with
{Q3=if(Q2_SQ4=="Y","Y","N")}

And .... wait for next release ( see: bugs.limesurvey.org/view.php?id=7895 ).

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).

Please Log in to join the conversation.

More
3 years 8 months ago #97518 by bwoo5
Hi Denis,

I understand that is how you would do it in 2.0 with EM but we are actually on 1.91 so i need javascript that will do it. We are looking to upgrade to 2.0 soon, just not at a time where we can do now because of live surveys.

Please Log in to join the conversation.

More
3 years 8 months ago #97541 by DenisChenu
Hello,

With same page ?

Then somethink like that, need updating var at start.
<script>
 
$(function() {
var thisqid=212;
$("#question"+thisqid).hide();
var checkboxid="answerSGQA";
$("#"+checkboxid).click(function(){
if($(this).is(":checked")){
$("#question"+thisqid).find("input.radio[value='Y']").click();
}else{
$("#question"+thisqid).find("input.radio[value='N']").click();
}
}
});
</script>

Denis
PS: i never test javascript put in forum: you have to test and correct it.

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).

Please Log in to join the conversation.