Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

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

filling in a radio button if a multiple choice response is selected 3 years 3 weeks ago #97511

  • bwoo5
  • bwoo5's Avatar
  • Offline
  • Expert Lime
  • Posts: 80
  • Thank you received: 4
  • Karma: 0
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 3 weeks ago by bwoo5.
The administrator has disabled public write access.

filling in a radio button if a multiple choice response is selected 3 years 3 weeks ago #97516

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9254
  • Thank you received: 1319
  • Karma: 382
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 developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.

filling in a radio button if a multiple choice response is selected 3 years 3 weeks ago #97518

  • bwoo5
  • bwoo5's Avatar
  • Offline
  • Expert Lime
  • Posts: 80
  • Thank you received: 4
  • Karma: 0
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.
The administrator has disabled public write access.

filling in a radio button if a multiple choice response is selected 3 years 3 weeks ago #97541

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9254
  • Thank you received: 1319
  • Karma: 382
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 developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.411 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form